model = model('Templatelist'); } public function index() { //设置过滤方法 $this->request->filter(['strip_tags']); if ($this->request->isAjax()) { list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $total = $this->model ->where($where) ->where('admin_id','in',$this->auth->id) ->order($sort, $order) ->count(); $list = $this->model ->where($where) ->where('admin_id','in',$this->auth->id) ->order($sort, $order) ->limit($offset, $limit) ->select(); $result = array("total" => $total, "rows" => $list); return json($result); } return $this->view->fetch(); } }