diff --git a/app/api/controller/Invite.php b/app/api/controller/Invite.php index 46d16e9b..26154c94 100644 --- a/app/api/controller/Invite.php +++ b/app/api/controller/Invite.php @@ -78,4 +78,37 @@ class Invite extends Controller $data = compact('refuse_num', 'adoption_num', 'money'); return $this->renderSuccess($data); } + + /** + * @notes:邀请采购商列表 + * @return Json + * @throws BaseException + * @throws DbException + * @author: wanghousheng + */ + public function inviteWholesalerList(): Json + { + $data['list'] = []; + $data['total'] = 0; + $model = new InviteLog(); + $user_ids = $model->inviteeUserIds(); + $status = intval($this->request->post('status', 10)); + if ($user_ids) { + $applyModel = new Apply(); + $list = $applyModel->whereIn('user_id', $user_ids) + ->with(['avatarImg']) + ->where(['status' => $status]) + ->field(['username', 'mobile', 'avatar_id', 'create_time']) + ->order('id desc') + ->paginate(15); + $data['list'] = $list->items(); + if (!empty($data['list'])) { + foreach ($data['list'] as &$item) { + $item['create_time'] = date('Y-m-d H:i:s', $item['create_time']); + } + } + $data['total'] = $list->total(); + } + return $this->renderSuccess($data); + } } \ No newline at end of file diff --git a/app/api/controller/Wholesaler.php b/app/api/controller/Wholesaler.php index b1a2311f..36683776 100644 --- a/app/api/controller/Wholesaler.php +++ b/app/api/controller/Wholesaler.php @@ -234,5 +234,4 @@ class Wholesaler extends Controller } return $this->renderError('操作失败'); } - } \ No newline at end of file diff --git a/app/common/model/wholesaler/Apply.php b/app/common/model/wholesaler/Apply.php index e3fc5fea..1a5af12d 100644 --- a/app/common/model/wholesaler/Apply.php +++ b/app/common/model/wholesaler/Apply.php @@ -73,7 +73,7 @@ class Apply extends BaseModel } /** - * 门头照片 + * 头像照片 * @return HasOne */ public function avatarImg(): HasOne