From 7b458368322515a5d3b52f7b388a7c19659d065e Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 14 Mar 2024 11:28:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=83=9F=E9=85=92?= =?UTF-8?q?=E5=BA=97=E5=91=98=E5=B7=A5=E4=BF=A1=E6=81=AF=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/user/User.php | 23 +++++++++++++++++++ .../store/service/StoreServiceRepository.php | 3 ++- app/controller/api/Auth.php | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/common/model/user/User.php b/app/common/model/user/User.php index 36bae49..a283dd1 100644 --- a/app/common/model/user/User.php +++ b/app/common/model/user/User.php @@ -239,6 +239,29 @@ class User extends BaseModel return !empty($info) ? $info->toArray() : null; } + public function getSmokeMerServiceAttr(){ + $info = (new StoreService()) + ->field('service_id,uid,nickname,avatar,customer,StoreService.mer_id,is_verify,is_goods,is_open') + ->hasWhere('merchant',function($query){ + $query->where('is_del', 0) + ->where('mer_state', 1) + ->where('merchant_type', 3) + ->where('status', 1); + }) + ->where('uid',$this->uid) + ->where('StoreService.mer_id','<>',0) + ->where('StoreService.is_del',0) + ->where('is_open',1) + ->order('StoreService.is_verify DESC,StoreService.customer DESC') + // ->fetchSql() + ->find(); + + return !empty($info) ? $info->toArray() : null; + } + + + + public function topService() { return $this->hasOne(StoreService::class, 'uid', 'uid') diff --git a/app/common/repositories/store/service/StoreServiceRepository.php b/app/common/repositories/store/service/StoreServiceRepository.php index b842a86..bf83a12 100644 --- a/app/common/repositories/store/service/StoreServiceRepository.php +++ b/app/common/repositories/store/service/StoreServiceRepository.php @@ -110,7 +110,7 @@ class StoreServiceRepository extends BaseRepository else if($merchantType == 1 || $merchantType == 3){ $adminRule = [ Elm::switches('is_verify', '核销权限', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), - Elm::switches('product_exchange', '商品兑换码', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), + // Elm::switches('product_exchange', '商品兑换码', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), Elm::switches('purchase_permission', '进货权限', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8), ]; $filed = [ @@ -248,6 +248,7 @@ class StoreServiceRepository extends BaseRepository ->select() ->hidden(['pwd']) ->toArray(); + // 是否处理总平台客服信息 if($is_sys == 1){ $config = systemConfig(['site_logo','site_name']); diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index eaac400..126d82a 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -147,7 +147,7 @@ class Auth extends BaseController public function userInfo() { $user = $this->request->userInfo()->hidden(['label_id', 'group_id', 'pwd', 'addres', 'card_id', 'last_time', 'last_ip', 'create_time', 'mark', 'status', 'spread_uid', 'spread_time', 'real_name', 'birthday', 'brokerage_price']); - $user->append(['service', 'topService','shopMerService', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread', 'total_recharge', 'lock_integral', 'total_integral']); + $user->append(['service', 'topService','shopMerService','smokeMerService', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread', 'total_recharge', 'lock_integral', 'total_integral']); $data = $user->toArray(); $data['total_consume'] = $user['pay_price']; $data['extension_status'] = systemConfig('extension_status');