model = model('AdminLog'); } /** * 查看 */ public function index() { if ($this->request->isAjax()) { list($where, $sort, $order, $offset, $limit) = $this->buildparams(null); $total = $this->model ->where($where) ->order($sort, $order) ->count(); $list = $this->model ->where($where) ->order($sort, $order) ->limit($offset, $limit) ->select(); $result = array("total" => $total, "rows" => $list); return json($result); } return $this->view->fetch(); } /** * 详情 */ public function detail($ids) { $row = $this->model->get(['id' => $ids]); if (!$row) { $this->error(__('No Results were found')); } $this->view->assign("row", $row->toArray()); return $this->view->fetch(); } }