ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 代码 ``` <?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(); } } ```