diff --git a/app/api/controller/user/UserController.php b/app/api/controller/user/UserController.php index 45298fdc..066a18d8 100644 --- a/app/api/controller/user/UserController.php +++ b/app/api/controller/user/UserController.php @@ -40,7 +40,7 @@ class UserController extends BaseApiController { $params = (new UserValidate())->post()->goCheck('changeMobile'); $result = UserLogic::changeMobile($params, $this->userId); - if($result) { + if ($result) { return $this->success('修改成功'); } return $this->fail(UserLogic::getError()); @@ -51,7 +51,7 @@ class UserController extends BaseApiController { $params = (new SystemUserValidate())->post()->goCheck('bind'); $result = UserLogic::bindSystemUser($params, $this->userInfo); - if($result) { + if ($result) { return $this->success('操作成功'); } return $this->fail(UserLogic::getError()); @@ -63,7 +63,7 @@ class UserController extends BaseApiController { $params = (new UserValidate())->post()->goCheck('edit'); $result = UserLogic::updateUser($params,$this->userId); - if($result) { + if ($result) { return $this->success('更新成功'); } return $this->fail(UserLogic::getError()); diff --git a/app/api/logic/UserLogic.php b/app/api/logic/UserLogic.php index 1097afe6..4be1707b 100644 --- a/app/api/logic/UserLogic.php +++ b/app/api/logic/UserLogic.php @@ -88,7 +88,7 @@ class UserLogic extends BaseLogic //更新用户信息 public static function updateUser(array $params, int $uid): bool { - if(empty($params)){ + if (empty($params)) { self::setError('参数列表为空'); return false; } @@ -101,7 +101,7 @@ class UserLogic extends BaseLogic try { User::update($params); return true; - }catch (\Exception $e){ + } catch (\Exception $e) { self::setError($e->getMessage()); return false; } @@ -133,7 +133,7 @@ class UserLogic extends BaseLogic ]); } return true; - }catch (\Exception $e){ + } catch (\Exception $e) { self::setError($e->getMessage()); return false; } diff --git a/app/common/validate/user/SystemUserValidate.php b/app/common/validate/user/SystemUserValidate.php index 89cae556..266ed681 100644 --- a/app/common/validate/user/SystemUserValidate.php +++ b/app/common/validate/user/SystemUserValidate.php @@ -27,7 +27,7 @@ class SystemUserValidate extends BaseValidate public function checkApp($appid): bool|string { $app = System::field('id, status')->where('app_id',$appid)->findOrEmpty(); - if($app->isEmpty()){ + if ($app->isEmpty()) { return '应用错误'; } if ($app['status'] != 0) {