| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace app\admin\controller\ps;
- use app\common\controller\Backend;
- /**
- * 流程单-产品
- *
- * @icon fa fa-cubes
- */
- class Product extends Backend
- {
- /**
- * Product模型对象
- * @var \app\admin\model\ps\Product
- */
- protected $model = null;
- protected $relationSearch = true;
- protected $searchFields = 'id,code,name';
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\ps\Product;
- $this->view->assign("statusList", $this->model->getStatusList());
- }
- public function import()
- {
- parent::import();
- }
- /**
- * 查看
- */
- public function index()
- {
- $this->request->filter(['strip_tags', 'trim']);
- if ($this->request->isAjax()) {
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $list = $this->model
- ->with(['factory'])
- ->where($where)
- ->order($sort, $order)
- ->paginate($limit);
- $result = array("total" => $list->total(), "rows" => $list->items());
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|