From d3f166088cf8b98bd0ac871867463b0041f1b67a Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 14 Mar 2024 10:46:08 +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=E9=83=A8=E5=88=86=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/system/merchant/MerchantDao.php | 2 +- .../store/service/StoreServiceRepository.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index 8b97fa7..1138c2d 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -38,7 +38,7 @@ class MerchantDao extends BaseDao public function search(array $where, $is_del = 0) { $merchantType = $where['merchant_type'] ?? 0; - $merchantType = in_array((int)$merchantType,[0,1,2]) ? $merchantType : 0;// 类型非法,使用默认类型 + $merchantType = in_array((int)$merchantType,[0,1,2,3]) ? $merchantType : 0;// 类型非法,使用默认类型 $query = Merchant::getDB() ->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) { diff --git a/app/common/repositories/store/service/StoreServiceRepository.php b/app/common/repositories/store/service/StoreServiceRepository.php index ba593e7..b842a86 100644 --- a/app/common/repositories/store/service/StoreServiceRepository.php +++ b/app/common/repositories/store/service/StoreServiceRepository.php @@ -107,7 +107,7 @@ class StoreServiceRepository extends BaseRepository ] ]; } - else if($merchantType == 1){ + 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), @@ -197,8 +197,8 @@ class StoreServiceRepository extends BaseRepository // 获取当前用户的员工信息 public function getServices($uid, array $where = [],$is_sys = 1){ // $where['uid'] = $uid; - // 商户类别(merchant_type):0=普通商户,1=酒道馆,2=供应商 - // is_sys:0=商户管理,1=平台管理,2=酒道馆管理 + // 商户类别(merchant_type):0=普通商户,1=酒道馆,2=供应商,3=烟酒店 + // is_sys:0=商户管理,1=平台管理,2=酒道馆管理,3=烟酒店 $list = $this->dao->getSearch([]) ->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where, $is_sys, $uid){ // 存在指定商户ID 并且为酒道馆 @@ -214,7 +214,12 @@ class StoreServiceRepository extends BaseRepository },function($query) use ($is_sys, $uid){ // 不存在指定商户id $query->hasWhere('merchant',function($query) use ($is_sys){ - $query->where('is_del', 0)->where('merchant_type', $is_sys == 2 ? 1 : 0); + // 商户类别(merchant_type):0=普通商户,1=酒道馆,2=供应商,3=烟酒店 + // is_sys:0=商户管理,1=平台管理,2=酒道馆管理,3=烟酒店 + $merchantType = 0; + if($is_sys == 2) $merchantType = 1; + else if($is_sys == 3) $merchantType = 3; + $query->where('is_del', 0)->where('merchant_type', $merchantType); })->where('StoreService.mer_id',$is_sys == 1 ? '=' : '>',0) ->where('StoreService.uid',$uid); })