Simulator.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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('sim_sim_type', ConfigModel::getSimTypeList());
  32. $this->assign('simNum', $simNum);
  33. $this->assignConfig('url_type', config('site.url_type'));
  34. return $this->view->fetch();
  35. }
  36. }