diff --git a/app/adminapi/logic/systems/SystemLogic.php b/app/adminapi/logic/systems/SystemLogic.php index da52f149..2c2a05d7 100644 --- a/app/adminapi/logic/systems/SystemLogic.php +++ b/app/adminapi/logic/systems/SystemLogic.php @@ -16,6 +16,7 @@ class SystemLogic extends BaseLogic 'url' => $params['url'], 'app_id' => create_app_id(), 'app_key' => create_app_key(), + 'register_status' => $params['register_status'], 'status' => 0, ]); return true; @@ -50,6 +51,7 @@ class SystemLogic extends BaseLogic 'name' => $params['name'], 'url' => $params['url'], 'status' => $params['status'], + 'register_status' => $params['register_status'], 'update_time' => time() ]); return true; @@ -62,7 +64,7 @@ class SystemLogic extends BaseLogic // 查看 public static function detail($params) : array { - $data = System::field('id,name,app_id,app_key,url,status,create_time')->findOrEmpty($params['id']); + $data = System::field('id,name,app_id,app_key,url,register_status,status,create_time')->findOrEmpty($params['id']); $data['status_text'] = $data->status_text; return $data->toArray(); } diff --git a/app/adminapi/logic/user/UserLogic.php b/app/adminapi/logic/user/UserLogic.php index 0cefca61..62ed758d 100644 --- a/app/adminapi/logic/user/UserLogic.php +++ b/app/adminapi/logic/user/UserLogic.php @@ -19,7 +19,7 @@ class UserLogic extends BaseLogic $user = User::field($field)->where(['id' => $userId])->findOrEmpty(); $user['gender_text'] = $user->gender_text; $user['status_text'] = $user->status_text; - $user['app_list'] = Db::name('system_user')->alias('su')->leftJoin('dc_system s','su.app_id = s.app_id')->field(['s.id', 's.app_id', 's.name'])->select(); + $user['app_list'] = Db::name('system_user')->alias('su')->leftJoin('dc_system s','su.app_id = s.app_id')->where('su.user_id', $userId)->field(['s.id', 's.app_id', 's.name'])->select(); return $user->toArray(); } diff --git a/app/common/validate/systems/SystemValidate.php b/app/common/validate/systems/SystemValidate.php index 423e4594..fb111994 100644 --- a/app/common/validate/systems/SystemValidate.php +++ b/app/common/validate/systems/SystemValidate.php @@ -16,6 +16,7 @@ class SystemValidate extends BaseValidate 'name' => 'require|unique:system', 'url' => 'require|uri|unique:system', 'status' => 'require|in:0,1', + 'register_status' => 'require|in:0,1', ]; protected $message = [ @@ -27,16 +28,18 @@ class SystemValidate extends BaseValidate 'url.unique' => '系统网址已被使用', 'status.require' => '请选择系统状态', 'status.in' => '系统状态值错误', + 'register_status.require' => '请选择系统注册状态', + 'register_status.in' => '系统注册状态值错误', ]; public function sceneAdd(): SystemValidate { - return $this->only(['name','url']); + return $this->only(['name','url', 'register_status']); } public function sceneEdit(): SystemValidate { - return $this->only(['id','name','url','status']); + return $this->only(['id','name','url','status','register_status']); } public function sceneDetail(): SystemValidate