model = new SystemLog(); } /** * @NodeAnotation(title="列表") */ public function index() { if ($this->request->isAjax()) { if (input('selectFields')) { return $this->selectList(); } [$page, $limit, $where, $excludeFields] = $this->buildTableParams(['month']); $month = !empty($excludeFields['month']) ? date('Ym', strtotime($excludeFields['month'])) : date('Ym'); $model = $this->model->setMonth($month)->with('admin')->where($where); try { $count = $model->count(); $list = $model->page($page, $limit)->order($this->sort)->select(); } catch (PDOException | DbException $exception) { $count = 0; $list = []; } $data = [ 'code' => 0, 'msg' => '', 'count' => $count, 'data' => $list, ]; return json($data); } return $this->fetch(); } }