更新细节

This commit is contained in:
yaooo 2023-11-13 16:19:48 +08:00
parent f33290b57d
commit 162dc06c8d
3 changed files with 7 additions and 7 deletions

View File

@ -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());

View File

@ -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;
}

View File

@ -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) {