更新细节
This commit is contained in:
parent
f33290b57d
commit
162dc06c8d
|
@ -40,7 +40,7 @@ class UserController extends BaseApiController
|
||||||
{
|
{
|
||||||
$params = (new UserValidate())->post()->goCheck('changeMobile');
|
$params = (new UserValidate())->post()->goCheck('changeMobile');
|
||||||
$result = UserLogic::changeMobile($params, $this->userId);
|
$result = UserLogic::changeMobile($params, $this->userId);
|
||||||
if($result) {
|
if ($result) {
|
||||||
return $this->success('修改成功');
|
return $this->success('修改成功');
|
||||||
}
|
}
|
||||||
return $this->fail(UserLogic::getError());
|
return $this->fail(UserLogic::getError());
|
||||||
|
@ -51,7 +51,7 @@ class UserController extends BaseApiController
|
||||||
{
|
{
|
||||||
$params = (new SystemUserValidate())->post()->goCheck('bind');
|
$params = (new SystemUserValidate())->post()->goCheck('bind');
|
||||||
$result = UserLogic::bindSystemUser($params, $this->userInfo);
|
$result = UserLogic::bindSystemUser($params, $this->userInfo);
|
||||||
if($result) {
|
if ($result) {
|
||||||
return $this->success('操作成功');
|
return $this->success('操作成功');
|
||||||
}
|
}
|
||||||
return $this->fail(UserLogic::getError());
|
return $this->fail(UserLogic::getError());
|
||||||
|
@ -63,7 +63,7 @@ class UserController extends BaseApiController
|
||||||
{
|
{
|
||||||
$params = (new UserValidate())->post()->goCheck('edit');
|
$params = (new UserValidate())->post()->goCheck('edit');
|
||||||
$result = UserLogic::updateUser($params,$this->userId);
|
$result = UserLogic::updateUser($params,$this->userId);
|
||||||
if($result) {
|
if ($result) {
|
||||||
return $this->success('更新成功');
|
return $this->success('更新成功');
|
||||||
}
|
}
|
||||||
return $this->fail(UserLogic::getError());
|
return $this->fail(UserLogic::getError());
|
||||||
|
|
|
@ -88,7 +88,7 @@ class UserLogic extends BaseLogic
|
||||||
//更新用户信息
|
//更新用户信息
|
||||||
public static function updateUser(array $params, int $uid): bool
|
public static function updateUser(array $params, int $uid): bool
|
||||||
{
|
{
|
||||||
if(empty($params)){
|
if (empty($params)) {
|
||||||
self::setError('参数列表为空');
|
self::setError('参数列表为空');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class UserLogic extends BaseLogic
|
||||||
try {
|
try {
|
||||||
User::update($params);
|
User::update($params);
|
||||||
return true;
|
return true;
|
||||||
}catch (\Exception $e){
|
} catch (\Exception $e) {
|
||||||
self::setError($e->getMessage());
|
self::setError($e->getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ class UserLogic extends BaseLogic
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}catch (\Exception $e){
|
} catch (\Exception $e) {
|
||||||
self::setError($e->getMessage());
|
self::setError($e->getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class SystemUserValidate extends BaseValidate
|
||||||
public function checkApp($appid): bool|string
|
public function checkApp($appid): bool|string
|
||||||
{
|
{
|
||||||
$app = System::field('id, status')->where('app_id',$appid)->findOrEmpty();
|
$app = System::field('id, status')->where('app_id',$appid)->findOrEmpty();
|
||||||
if($app->isEmpty()){
|
if ($app->isEmpty()) {
|
||||||
return '应用错误';
|
return '应用错误';
|
||||||
}
|
}
|
||||||
if ($app['status'] != 0) {
|
if ($app['status'] != 0) {
|
||||||
|
|
Loading…
Reference in New Issue