企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
#### index基础函数 > 可以仿照为base,其他根据需求更改 ```php public function index() { if (Request::isPost()) { // 关键词查询 $keys = $this->request->post('keys', '', 'trim'); $where = []; if ($keys != '') { $where[] = ['title', 'like', '%' . $keys . '%']; } // 分页 $page = $this->request->post('page'); $limit = $this->request->post('limit'); $tol = ($page - 1) * $limit; // 查询需要展示的数据 $banner = BannerModel::where($where)->limit($tol, $limit)->select(); $count = BannerModel::where($where)->count(); if (!$banner) $this->errorMsg(); $this->successMsg($banner, $count); } return view(); } ```