From 4b0283071a3d56b62f9e83bd38ce4ce0fd876531 Mon Sep 17 00:00:00 2001 From: fengxinyhyl Date: Mon, 22 Apr 2024 17:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E4=BA=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/user/UserDao.php | 2 +- .../repositories/system/CacheRepository.php | 4 ++++ app/common/repositories/user/UserRepository.php | 6 +++--- app/controller/api/user/User.php | 17 +++++++++++++---- view/admin/src/views/user/list/index.vue | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/common/dao/user/UserDao.php b/app/common/dao/user/UserDao.php index 23d9111..4bb2c45 100644 --- a/app/common/dao/user/UserDao.php +++ b/app/common/dao/user/UserDao.php @@ -72,7 +72,7 @@ class UserDao extends BaseDao } $query->whereNull('User.cancel_time') ->when(isset($where['keyword']) && $where['keyword'], function (BaseQuery $query) use ($where) { - return $query->where('User.uid|User.real_name|User.nickname|User.phone', 'like', '%' . $where['keyword'] . '%'); + return $query->where('User.uid|User.account|User.real_name|User.nickname|User.phone', 'like', '%' . $where['keyword'] . '%'); })->when(isset($where['user_type']) && $where['user_type'] !== '', function (BaseQuery $query) use ($where) { return $query->where('User.user_type', $where['user_type']); })->when(isset($where['uid']) && $where['uid'] !== '', function (BaseQuery $query) use ($where) { diff --git a/app/common/repositories/system/CacheRepository.php b/app/common/repositories/system/CacheRepository.php index ead6741..02b4302 100644 --- a/app/common/repositories/system/CacheRepository.php +++ b/app/common/repositories/system/CacheRepository.php @@ -66,6 +66,8 @@ class CacheRepository extends BaseRepository const COUPON_AGREE = 'sys_coupon_agree'; //付费会员协议 const SYS_SVIP = 'sys_svip'; + //品质与服务承诺书 + const SYS_MERCHANT_SERVE = 'sys_merchant_serve'; public function getAgreeList($type) { @@ -75,6 +77,7 @@ class CacheRepository extends BaseRepository ['label' => '平台规则', 'key' => self::PLATFORM_RULE], ['label' => '注销重要提示', 'key' => self::CANCELLATION_PROMPT], ['label' => '商户入驻申请协议', 'key' => self::INTEGRAL_AGREE], + ['label' => '品质与服务承诺书', 'key' => self::SYS_MERCHANT_SERVE], ]; if (!$type) { $data[] = ['label' => '注销声明', 'key' => self::CANCELLATION_MSG]; @@ -104,6 +107,7 @@ class CacheRepository extends BaseRepository self::PLATFORM_RULE, self::COUPON_AGREE, self::SYS_SVIP, + self::SYS_MERCHANT_SERVE, ]; } diff --git a/app/common/repositories/user/UserRepository.php b/app/common/repositories/user/UserRepository.php index b15719a..64087c7 100644 --- a/app/common/repositories/user/UserRepository.php +++ b/app/common/repositories/user/UserRepository.php @@ -1033,11 +1033,11 @@ class UserRepository extends BaseRepository * @author xaboy * @day 2020/6/22 */ - public function getOneLevelList($uid, $nickname, $sort, $page, $limit) + public function getOneLevelList($uid, $keyword, $sort, $page, $limit) { - $query = $this->search(['spread_uid' => $uid, 'nickname' => $nickname, 'sort' => $sort]); + $query = $this->search(['spread_uid' => $uid, 'keyword' => $keyword, 'sort' => $sort]); $count = $query->count(); - $list = $query->setOption('field', [])->field('uid,avatar,nickname,pay_count,pay_price,spread_count,spread_time')->page($page, $limit)->select(); + $list = $query->setOption('field', [])->field('uid,avatar,nickname,phone,create_time')->page($page, $limit)->select(); return compact('list', 'count'); } diff --git a/app/controller/api/user/User.php b/app/controller/api/user/User.php index 52c5bfc..d20fa37 100644 --- a/app/controller/api/user/User.php +++ b/app/controller/api/user/User.php @@ -325,12 +325,21 @@ class User extends BaseController */ public function spread_list() { - [$level, $sort, $nickname] = $this->request->params(['level', 'sort', 'keyword'], true); + $keyword = $this->request->param('keyword', ''); $uid = $this->request->uid(); + $user = $this->user; [$page, $limit] = $this->getPage(); - return app('json')->success($level == 2 - ? $this->repository->getTwoLevelList($uid, $nickname, $sort, $page, $limit) - : $this->repository->getOneLevelList($uid, $nickname, $sort, $page, $limit)); + + $data = $this->repository->getOneLevelList($uid, $keyword, 'create_time', $page, $limit); + $spread = $this->repository->get($user['spread_uid']); + if($spread){ + $data['spread'] = array('uid' => $spread['uid'], 'avatar' => $spread['avatar'], + 'nickname' => $spread['nickname'], 'phone' => $spread['phone']); + }else{ + $data['spread'] = null; + } + + return app('json')->success($data); } /** diff --git a/view/admin/src/views/user/list/index.vue b/view/admin/src/views/user/list/index.vue index fde0d86..4f8cae7 100644 --- a/view/admin/src/views/user/list/index.vue +++ b/view/admin/src/views/user/list/index.vue @@ -196,7 +196,7 @@ 设为项目经理 设为区域代理 - + 修改推荐人