model = model('AdminLog'); } /** * 查看 */ public function index() { $this->relationSearch = true; $this->searchFields = "admin.username,id"; if ($this->request->isAjax()) { list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model ->with("admin") ->where($where) ->order($sort, $order) ->paginate($limit); $result = array("total" => $list->total(), "rows" => $list->items()); return json($result); } return $this->view->fetch(); } }