From 162dc06c8d4ed34a1151c91743878440465f0159 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 13 Nov 2023 16:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/user/UserController.php | 6 +++--- app/api/logic/UserLogic.php | 6 +++--- app/common/validate/user/SystemUserValidate.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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) {