Simulator.php 979 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\model\Admin;
  4. use app\admin\model\User;
  5. use app\common\controller\Backend;
  6. use app\common\model\Attachment;
  7. use app\common\model\Config as ConfigModel;
  8. use fast\Date;
  9. use think\Db;
  10. use think\Env;
  11. class Simulator extends Backend
  12. {
  13. /**
  14. * 查看
  15. */
  16. public function index()
  17. {
  18. $simNum = [];
  19. if(Env::get('app.is_fault')){
  20. $url = config('site.url_type').'/sim/sim/listAllEnable';
  21. $ret = json_decode(send_get($url),true);
  22. if($ret['code'] == 200){
  23. foreach ($ret['data'] as $k => $val){
  24. $simNum[] = [
  25. 'simNum'=>$val['simNum'],
  26. 'simType'=>$val['simType'],
  27. ];
  28. }
  29. }
  30. }
  31. $this->assign('simNum', $simNum);
  32. $this->assignConfig('url_type', config('site.url_type'));
  33. return $this->view->fetch();
  34. }
  35. }