PrintJob.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\admin\controller\ps;
  3. use app\common\controller\Backend;
  4. /**
  5. * 流程单-打印任务
  6. *
  7. * @icon fa fa-print
  8. */
  9. class PrintJob extends Backend
  10. {
  11. /**
  12. * Print_job模型对象
  13. * @var \app\admin\model\ps\Print_job
  14. */
  15. protected $model = null;
  16. protected $relationSearch = true;
  17. protected $searchFields = 'id,print_no';
  18. public function _initialize()
  19. {
  20. parent::_initialize();
  21. $this->model = new \app\admin\model\ps\Print_job;
  22. $this->view->assign("statusList", $this->model->getStatusList());
  23. $this->view->assign("bizTypeList", $this->model->getBizTypeList());
  24. $this->view->assign("lodopModeList", $this->model->getLodopModeList());
  25. }
  26. /**
  27. * 查看
  28. */
  29. public function index()
  30. {
  31. $this->request->filter(['strip_tags', 'trim']);
  32. if ($this->request->isAjax()) {
  33. if ($this->request->request('keyField')) {
  34. return $this->selectpage();
  35. }
  36. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  37. $list = $this->model
  38. ->with(['factory'])
  39. ->where($where)
  40. ->order($sort, $order)
  41. ->paginate($limit);
  42. $result = array("total" => $list->total(), "rows" => $list->items());
  43. return json($result);
  44. }
  45. return $this->view->fetch();
  46. }
  47. }