💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 控制器 ## 代码 ``` <?php namespace app\agent\controller; use app\agent\model\UserModel as UserModel; use think\Controller; class UserController extends Controller { /** * 管理员列表 */ public function index() { $userModel = new UserModel(); $where = ["user_type" => 1]; /**搜索条件**/ $user_login = $this->request->param('user_login'); $user_email = trim($this->request->param('user_email')); if ($user_login) { $where['user_login'] = ['like', "%$user_login%"]; } if ($user_email) { $where['user_email'] = ['like', "%$user_email%"];; } $users = $userModel ->where($where) ->order("id DESC") ->paginate(10); // 获取分页显示 $page = $users->render(); $this->assign("page", $page); $this->assign("users", $users); return $this->fetch(); } } ```