|
|
@ -11,6 +11,7 @@ use app\model\AuthRoleModel; |
|
|
|
use app\model\AwsS3Model; |
|
|
|
use app\model\CountryModel; |
|
|
|
use app\model\GroupLeaderWithUserModel; |
|
|
|
use app\model\PurchaseVipModel; |
|
|
|
use app\model\SellerWithUserModel; |
|
|
|
use app\model\StockMarketModel; |
|
|
|
use app\model\UserBankModel; |
|
|
@ -339,6 +340,9 @@ class UserService extends AdminBaseService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 用户vip信息 |
|
|
|
$vipInfo = PurchaseVipModel::where('user_id', 'in', $userIdArr)->column('user_id,expire', 'user_id'); |
|
|
|
|
|
|
|
// 用户阶段信息 |
|
|
|
$userStageStateList = UserStageStateModel::where('user_id', 'in', $userIdArr)->column('first_stage,first_stage_state,second_stage,second_stage_state,third_stage,third_stage_state', 'user_id'); |
|
|
|
|
|
|
@ -367,6 +371,13 @@ class UserService extends AdminBaseService |
|
|
|
if ($sellerId) { |
|
|
|
$sellerName = $accountList[$sellerId] ?? ""; // 电销员名称 |
|
|
|
} |
|
|
|
// vip信息 |
|
|
|
$isVip = false; |
|
|
|
$vipExpire = -1; |
|
|
|
if (isset($vipInfo[$item['user_id']]['expire']) && $vipInfo[$item['user_id']]['expire'] >= date("Y-m-d H:i:s")) { |
|
|
|
$isVip = true; |
|
|
|
$vipExpire = $vipInfo[$item['user_id']]['expire']; |
|
|
|
} |
|
|
|
|
|
|
|
$rows[] = [ |
|
|
|
'id' => $item['user_id'], |
|
|
@ -396,6 +407,8 @@ class UserService extends AdminBaseService |
|
|
|
'second_stage_state' => $userStageStateList[$item['user_id']]['second_stage_state'] ?? 0, |
|
|
|
'third_stage' => $userStageStateList[$item['user_id']]['third_stage'] ?? '', |
|
|
|
'third_stage_state' => $userStageStateList[$item['user_id']]['third_stage_state'] ?? 0, |
|
|
|
'is_vip' => $isVip, // 是否vip |
|
|
|
'vip_expire' => $vipExpire, // vip到期时间 |
|
|
|
|
|
|
|
//余额 |
|
|
|
'digital' => $userDigitalList[$item['user_id']]['usable_num'] ?? '0', |
|
|
@ -1212,12 +1225,27 @@ class UserService extends AdminBaseService |
|
|
|
return $this->toData('0', 'success', ['code' => $code, 'expiration_time' => $time]); |
|
|
|
} |
|
|
|
|
|
|
|
// 用户银行卡 |
|
|
|
// 用户银行卡列表 |
|
|
|
public function bankList($param) |
|
|
|
{ |
|
|
|
try { |
|
|
|
$userId = $param['user_id'] ?? 0; |
|
|
|
if (empty($userId) || !is_numeric($userId)) { |
|
|
|
return $this->toData('400', 'Param error user_id', [$userId]); |
|
|
|
} |
|
|
|
$list = UserBankModel::where(['user_id'=>$param['user_id']])->select()->toArray(); |
|
|
|
return $this->toData('0', 'success', $list); |
|
|
|
} catch (\Exception $e) { |
|
|
|
return $this->toData('1', '系统异常 请稍后重试', [$e->getMessage(), $e->getTrace()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 用户银行卡详情 |
|
|
|
public function bankDetail($param) |
|
|
|
{ |
|
|
|
try { |
|
|
|
$userId = $param['user_id'] ?? ''; |
|
|
|
if (!is_numeric($userId)) { |
|
|
|
$userId = $param['user_id'] ?? 0; |
|
|
|
if (empty($userId) || !is_numeric($userId)) { |
|
|
|
return $this->toData('100400', 'Param error', []); |
|
|
|
} |
|
|
|
|
|
|
@ -1232,16 +1260,17 @@ class UserService extends AdminBaseService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 编辑银行卡信息 |
|
|
|
public function editBank($param) |
|
|
|
{ |
|
|
|
try { |
|
|
|
if (empty($param['id'])) { |
|
|
|
return $this->toData('100400', 'Param error', []); |
|
|
|
return $this->toData('400', '缺少参数id', []); |
|
|
|
} |
|
|
|
|
|
|
|
$bank = UserBankModel::getUserBankInfoById(['id' => $param['id']]); |
|
|
|
if (empty($bank)) { |
|
|
|
return $this->toData('100400', 'Param error', []); |
|
|
|
return $this->toData('400', '编辑的数据不存在', []); |
|
|
|
} |
|
|
|
|
|
|
|
$updateArr = [ |
|
|
|