feat(UserController, UserLogic): 添加了参数判断和简称获取逻辑,优化了用户信息获取方式,并更新了相关API接口。
This commit is contained in:
parent
915573615c
commit
c3cd0d6fe3
@ -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));
|
||||
}
|
||||
|
||||
// #[
|
||||
|
@ -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']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user