|
|
@@ -25,21 +25,21 @@ class ApplyService extends BaseService
|
|
|
$userIdList = array_column($list, 'userId');
|
|
|
$user = UserService::getUserByIds($userIdList);
|
|
|
//商家信息
|
|
|
- $oldList = array_column($list, 'oldId');
|
|
|
- $newIdList = array_column($list, 'newId');
|
|
|
- $idList = array_merge($newIdList, $oldList);
|
|
|
+ $oldList = array_column($list, 'introMerchantId');
|
|
|
+ $merchantIdList = array_column($list, 'merchantId');
|
|
|
+ $idList = array_merge($merchantIdList, $oldList);
|
|
|
$idList = array_unique(array_filter($idList));
|
|
|
$merchant = [];
|
|
|
if (!empty($idList)) {
|
|
|
$merchant = MerchantService::getMerchantByIds($idList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
foreach ($list as $key => $val) {
|
|
|
$userId = $val['userId'];
|
|
|
- $oldId = $val['oldId'];
|
|
|
+ $introMerchantId = $val['introMerchantId'];
|
|
|
$list[$key]['userName'] = isset($user[$userId]) ? $user[$userId]['userName'] : '';
|
|
|
$list[$key]['userAvatar'] = isset($user[$userId]['avatarUrl']) ? $user[$userId]['avatarUrl'] : '';
|
|
|
- $list[$key]['oldName'] = isset($merchant[$oldId]['merchantName']) ? $merchant[$oldId]['merchantName'] : '';
|
|
|
+ $list[$key]['oldName'] = isset($merchant[$introMerchantId]['merchantName']) ? $merchant[$introMerchantId]['merchantName'] : '';
|
|
|
}
|
|
|
$data['list'] = $list;
|
|
|
return $data;
|
|
|
@@ -51,23 +51,4 @@ class ApplyService extends BaseService
|
|
|
|
|
|
}
|
|
|
|
|
|
- //添加申请 shish 2019.12.23
|
|
|
- public static function addApply($data)
|
|
|
- {
|
|
|
- $mobile = isset($data['mobile']) ? $data['mobile'] : 0;
|
|
|
- if (stringUtil::isMobile($mobile) == false) {
|
|
|
- util::fail('请填写手机号');
|
|
|
- }
|
|
|
- $apply = ApplyClass::getByCondition(['mobile' => $mobile]);
|
|
|
- if (!empty($apply)) {
|
|
|
- util::fail('您已经申请过了');
|
|
|
- }
|
|
|
- $oldId = isset($data['oldId']) ? $data['oldId'] : 0;
|
|
|
- //有人邀请
|
|
|
- if (!empty($oldId)) {
|
|
|
-
|
|
|
- }
|
|
|
- ApplyClass::add($data);
|
|
|
- }
|
|
|
-
|
|
|
}
|