企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 代码 ``` <?php namespace app\agent\controller; use think\Controller; use think\Db; class UserController extends Controller { /** * 管理员编辑 */ public function edit() { $id = $this->request->param('id', 0, 'intval'); $roles = DB::name('role')->where(['status' => 1])->order("id DESC")->select(); $this->assign("roles", $roles); $role_ids = DB::name('RoleUser')->where(["user_id" => $id])->column("role_id"); $this->assign("role_ids", $role_ids); $user = DB::name('user')->where(["id" => $id])->find(); $this->assign($user); return $this->fetch(); } } ```