| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace app\admin\controller\ps;
- use app\common\controller\Backend;
- /**
- * 流程单-模板商品
- *
- * @icon fa fa-shopping-cart
- */
- class MarketGoods extends Backend
- {
- /**
- * Market_goods模型对象
- * @var \app\admin\model\ps\Market_goods
- */
- protected $model = null;
- protected $relationSearch = true;
- protected $searchFields = 'id,title';
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\ps\Market_goods;
- $this->view->assign("statusList", $this->model->getStatusList());
- }
- /**
- * 查看
- */
- 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();
- }
- }
|