Factory.php 1.3 KB

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