Expet.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 Expet extends Backend
  12. {
  13. protected $noNeedRight = ['getbindHardwareMsg'];
  14. /**
  15. * 查看
  16. */
  17. public function index()
  18. {
  19. $simNum = [];
  20. if(Env::get('app.is_fault')){
  21. $url = config('site.url_type').'/sim/sim/listAllEnable';
  22. $ret = json_decode(send_get($url),true);
  23. if($ret['code'] == 200){
  24. foreach ($ret['data'] as $k => $val){
  25. $simNum[] = [
  26. 'simNum'=>$val['simNum'],
  27. 'simType'=>$val['simType'],
  28. ];
  29. }
  30. }
  31. }
  32. // $this->assignConfig('sim_sim_type', ConfigModel::getSimTypeList());
  33. $this->assign('sim_sim_type', ConfigModel::getSimTypeList());
  34. $this->assign('simNum', $simNum);
  35. $this->assignConfig('url_type', config('site.url_type'));
  36. return $this->view->fetch();
  37. }
  38. public function getbindHardwareMsg($ids = null){
  39. if(Env::get('app.is_fault')){
  40. $url = config('site.url_type').'/sim/fault/listTypeGZBW/'.$ids;
  41. $ret = json_decode(send_get($url),true);
  42. if($ret['code'] == 200){
  43. $remind_day = '<option value="">请选择</option>';
  44. foreach ($ret['data'] as $key =>$val){
  45. $remind_day .= '<option value="'.$val['bindHardwareMsg'].'">'.$val['name'].'</option>';
  46. }
  47. $this->success($remind_day);
  48. }else{
  49. $this->error($ret['msg']);
  50. }
  51. }
  52. }
  53. }