diff --git a/app/adminapi/logic/systems/SystemLogic.php b/app/adminapi/logic/systems/SystemLogic.php index 2c2a05d7..646a5d1c 100644 --- a/app/adminapi/logic/systems/SystemLogic.php +++ b/app/adminapi/logic/systems/SystemLogic.php @@ -12,10 +12,13 @@ class SystemLogic extends BaseLogic { try{ System::create([ - 'name' => $params['name'], - 'url' => $params['url'], 'app_id' => create_app_id(), 'app_key' => create_app_key(), + 'name' => $params['name'], + 'url' => $params['url'], + 'down_url' => $params['down_url'], + 'icon' => $params['icon'], + 'app_version' => $params['app_version'], 'register_status' => $params['register_status'], 'status' => 0, ]); @@ -50,8 +53,11 @@ class SystemLogic extends BaseLogic 'id' => $params['id'], 'name' => $params['name'], 'url' => $params['url'], - 'status' => $params['status'], + 'down_url' => $params['down_url'], + 'icon' => $params['icon'], + 'app_version' => $params['app_version'], 'register_status' => $params['register_status'], + 'status' => $params['status'], 'update_time' => time() ]); return true; @@ -64,7 +70,7 @@ class SystemLogic extends BaseLogic // 查看 public static function detail($params) : array { - $data = System::field('id,name,app_id,app_key,url,register_status,status,create_time')->findOrEmpty($params['id']); + $data = System::field('*')->findOrEmpty($params['id']); $data['status_text'] = $data->status_text; return $data->toArray(); } diff --git a/app/common/validate/systems/SystemValidate.php b/app/common/validate/systems/SystemValidate.php index 79b138dd..9c2dc56e 100644 --- a/app/common/validate/systems/SystemValidate.php +++ b/app/common/validate/systems/SystemValidate.php @@ -14,8 +14,6 @@ class SystemValidate extends BaseValidate protected $rule = [ 'id' => 'require', 'name' => 'require|unique:system', - 'app_id' => 'require', - 'app_key' => 'require', 'icon' => 'require', 'app_version' => 'require', 'down_url' => 'require', @@ -39,12 +37,12 @@ class SystemValidate extends BaseValidate public function sceneAdd(): SystemValidate { - return $this->only(['name','app_id','app_key','icon','app_version','down_url','url','status','register_status']); + return $this->only(['name','icon','app_version','down_url','url','status','register_status']); } public function sceneEdit(): SystemValidate { - return $this->only(['id','name','app_id','app_key','icon','app_version','down_url','url','status','register_status']); + return $this->only(['id','name','icon','app_version','down_url','url','status','register_status']); } public function sceneDetail(): SystemValidate