多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 控制器 ## 代码 ``` <?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(); } } ```