model = new \addons\shopro\model\split\Rule; } public function index() { $this->request->filter(['strip_tags']); if ($this->request->isAjax()) { list($where, $sort, $order, $offset, $limit) = $this->custombuildparams(); $total = $this->model->where($where)->count(); $list = $this->model->where($where)->order('priority desc,id desc')->limit($offset, $limit)->select(); return $this->success('操作成功', null, ['total' => $total, 'rows' => $list]); } return $this->view->fetch(); } public function edit($ids = null) { $row = $this->model->get($ids); if (!$row) { $this->error('记录不存在'); } if ($this->request->isPost()) { $params = $this->request->post('row/a'); $row->save($params); $this->success('保存成功'); } $this->view->assign('row', $row); return $this->view->fetch(); } }