From c3cd0d6fe37dc85ce40e70ea129665c64a320c74 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 19 Aug 2024 20:42:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(UserController,=20UserLogic):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=8F=82=E6=95=B0=E5=88=A4=E6=96=AD=E5=92=8C?= =?UTF-8?q?=E7=AE=80=E7=A7=B0=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BA=86=E7=9B=B8=E5=85=B3API=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/user/UserController.php | 3 ++- app/api/logic/user/UserLogic.php | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/api/controller/user/UserController.php b/app/api/controller/user/UserController.php index 389a01ec..d4ea0558 100644 --- a/app/api/controller/user/UserController.php +++ b/app/api/controller/user/UserController.php @@ -68,7 +68,8 @@ class UserController extends BaseApiController // ] public function info() { - return $this->success('success', UserLogic::info($this->userId)); + $params=$this->request->post(); + return $this->success('success', UserLogic::info($this->userId,$params)); } // #[ diff --git a/app/api/logic/user/UserLogic.php b/app/api/logic/user/UserLogic.php index 921b2760..4c72f1b1 100644 --- a/app/api/logic/user/UserLogic.php +++ b/app/api/logic/user/UserLogic.php @@ -82,7 +82,7 @@ class UserLogic extends BaseLogic } - public static function info($uid) + public static function info($uid,$params) { $data = User::with(['userShip'])->where('id',$uid) ->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship @@ -123,10 +123,15 @@ class UserLogic extends BaseLogic $number = UserSign::where('uid',$uid)->where(['status'=>0])->sum('number'); $data['number'] =bcadd($number,0,2); $data['GetNumber'] =bcadd($GetNumber,0,2); - if($data['store_id']){ - $share_name=SystemStore::where('id',$data['store_id'])->value('abbreviation'); + + if(isset($params['store_id']) && $params['store_id']>0){ + $share_name=SystemStore::where('id',$params['store_id'])->value('abbreviation'); }else{ - $share_name=SystemStore::where('id',4)->value('abbreviation'); + if($data['store_id']){ + $share_name=SystemStore::where('id',$data['store_id'])->value('abbreviation'); + }else{ + $share_name=SystemStore::where('id',4)->value('abbreviation'); + } } $data['share_name']= $share_name.'No.'.preg_replace('/4/','*', $data['id']); $data['no_code']= 'No.'.preg_replace('/4/','*', $data['id']);