|
|
@@ -19,6 +19,9 @@ use app\common\{enum\notice\NoticeEnum,
|
|
|
enum\user\UserTerminalEnum,
|
|
|
enum\YesNoEnum,
|
|
|
logic\BaseLogic,
|
|
|
+ model\coupon\UserCoupon,
|
|
|
+ model\equity\UserEquity,
|
|
|
+ model\orders\OrderEffectiveLog,
|
|
|
model\user\User,
|
|
|
model\user\UserAuth,
|
|
|
service\FileService,
|
|
|
@@ -47,7 +50,7 @@ class UserLogic extends BaseLogic
|
|
|
public static function center(array $userInfo): array
|
|
|
{
|
|
|
$user = User::where(['id' => $userInfo['user_id']])
|
|
|
- ->field('id,sn,sex,account,nickname,real_name,avatar,mobile,create_time,is_new_user,user_money,password')
|
|
|
+ ->field('id,sn,sex,account,nickname,real_name,avatar,mobile,create_time,is_new_user,user_money')
|
|
|
->findOrEmpty();
|
|
|
|
|
|
if (in_array($userInfo['terminal'], [UserTerminalEnum::WECHAT_MMP, UserTerminalEnum::WECHAT_OA])) {
|
|
|
@@ -55,8 +58,10 @@ class UserLogic extends BaseLogic
|
|
|
$user['is_auth'] = $auth ? YesNoEnum::YES : YesNoEnum::NO;
|
|
|
}
|
|
|
|
|
|
- $user['has_password'] = !empty($user['password']);
|
|
|
- $user->hidden(['password']);
|
|
|
+ //查询用户优惠券、权益卡、保修卡、返修工单数量
|
|
|
+ $user['coupon_count'] = UserCoupon::where(['user_id' => $userInfo['user_id'] , 'voucher_status'=>0])->where('expire_time','>',time())->where('voucher_count','>',0)->count();
|
|
|
+ $user['equity_count'] = UserEquity::where(['user_id' => $userInfo['user_id']])->where('number','>',0)->count();
|
|
|
+ $user['effective_count'] = OrderEffectiveLog::where(['user_id' => $userInfo['user_id']])->where('end_effective_time','>',time())->where('effective_num','>',0)->count();
|
|
|
return $user->toArray();
|
|
|
}
|
|
|
|