Res.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace app\admin\controller;
  3. use app\common\controller\Backend;
  4. use \think\Db;
  5. /**
  6. * 检测结果管理管理
  7. *
  8. * @icon fa fa-circle-o
  9. */
  10. class Res extends Backend
  11. {
  12. /**
  13. * Res模型对象
  14. * @var \app\admin\model\Res
  15. */
  16. protected $model = null;
  17. protected $searchFields = 'entrust_no,name,bach,standard_name';
  18. public function _initialize()
  19. {
  20. parent::_initialize();
  21. $this->model = new \app\admin\model\Res;
  22. $this->view->assign("statusList", $this->model->getStatusList());
  23. }
  24. /**
  25. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  26. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  27. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  28. */
  29. //检测数据查看
  30. public function data(){
  31. $params = input('id');
  32. if (empty($params)){
  33. $this->error('参数错误');
  34. }
  35. $entrust_id = Db::name('res')->where('id',$params)->value('entrust_id');
  36. $gather_id = Db::name('entrust')->where('id',$entrust_id)->find();
  37. if (empty($gather_id['gather_id'])){
  38. $this->error('此委托单还未提交检测,暂无检测数据');
  39. }
  40. //此处根据实际获取到的采集表的数据 gather_tab 去对应表里查数据 重新写一个gc表格页面 js加代码
  41. if ($gather_id['gather_tab'] == 'gather_txt_check_gcms'){
  42. $gather = Db::name('gather_txt_gcms')->where('id',$gather_id['gather_id'])->find();
  43. $data = Db::name('gather_txt_check_gcms')->where('pid',$gather_id['gather_id'])->select();
  44. $this->view->assign('gather', $gather);
  45. $this->view->assign('data', $data);
  46. $this->view->assign('id', $params);
  47. return $this->view->fetch();
  48. }else if ($gather_id['gather_tab'] == 'gather_txt_check_gc'){
  49. $gather = Db::name('gather_txt_gc')->where('id',$gather_id['gather_id'])->find();
  50. $data = Db::name('gather_txt_check_gc')->where('pid',$gather_id['gather_id'])->select();
  51. $this->view->assign('gather', $gather);
  52. $this->view->assign('data', $data);
  53. $this->view->assign('id', $params);
  54. return $this->fetch('datagc');
  55. }
  56. }
  57. //数据报告
  58. public function report(){
  59. $this->error('此功能暂未开发');
  60. }
  61. }