💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
#### 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(); } ```