|
|
|
@ -97,6 +97,7 @@ class Invite extends Controller |
|
|
|
|
$data['adoption_num'] = 0; |
|
|
|
|
$data['refuse_num'] = 0; |
|
|
|
|
$model = new InviteLog(); |
|
|
|
|
$storeId = $this->storeId; |
|
|
|
|
$user_ids = $model->inviteeUserIds(); |
|
|
|
|
$status = intval($this->request->post('status')); |
|
|
|
|
if (!$status) { |
|
|
|
@ -117,8 +118,12 @@ class Invite extends Controller |
|
|
|
|
} |
|
|
|
|
$data['list'] = $list->items(); |
|
|
|
|
$data['total'] = $list->total(); |
|
|
|
|
//1.查询需要的邀请人数是多少 |
|
|
|
|
$setting = Setting::where(['key'=>'condition'])->field('values')->find(); |
|
|
|
|
$setting = json_decode($setting,true); |
|
|
|
|
$invite_num = $setting['values']['invite_num'] ?? 10; |
|
|
|
|
//审核通过 |
|
|
|
|
$data['adoption_num'] = $applyModel->whereIn('user_id', $user_ids)->where(['status' => WholesalerEnum::ADOPT])->count(); |
|
|
|
|
$data['adoption_num'] = ($applyModel->whereIn('user_id', $user_ids)->where(['status' => WholesalerEnum::ADOPT])->count()).'/'.$invite_num; |
|
|
|
|
//审核拒绝 |
|
|
|
|
$data['refuse_num'] = $applyModel->whereIn('user_id', $user_ids)->where(['status' => WholesalerEnum::REFUSE])->count(); |
|
|
|
|
} |
|
|
|
|