From be233e09b4689379d7c8d41c0c1e02aa8ce0b800 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Mon, 8 Apr 2024 12:20:00 +0800 Subject: [PATCH] 1 --- app/api/controller/Invite.php | 33 +++++++++++++++++++++++++++ app/api/controller/Wholesaler.php | 1 - app/common/model/wholesaler/Apply.php | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) 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