添加:烟酒店部分兼容

This commit is contained in:
wuhui_zzw 2024-03-14 10:46:08 +08:00
parent 045fb46855
commit d3f166088c
2 changed files with 10 additions and 5 deletions

View File

@ -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) {

View File

@ -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_sys0=商户管理1=平台管理2=酒道馆管理
// 商户类别(merchant_type)0=普通商户1=酒道馆2=供应商3=烟酒店
// is_sys0=商户管理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_sys0=商户管理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);
})