添加:烟酒店部分兼容
This commit is contained in:
parent
045fb46855
commit
d3f166088c
|
|
@ -38,7 +38,7 @@ class MerchantDao extends BaseDao
|
||||||
public function search(array $where, $is_del = 0)
|
public function search(array $where, $is_del = 0)
|
||||||
{
|
{
|
||||||
$merchantType = $where['merchant_type'] ?? 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()
|
$query = Merchant::getDB()
|
||||||
->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
|
->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class StoreServiceRepository extends BaseRepository
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
else if($merchantType == 1){
|
else if($merchantType == 1 || $merchantType == 3){
|
||||||
$adminRule = [
|
$adminRule = [
|
||||||
Elm::switches('is_verify', '核销权限', 1)->activeValue(1)->inactiveValue(0)->inactiveText('关')->activeText('开')->col(8),
|
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),
|
||||||
|
|
@ -197,8 +197,8 @@ class StoreServiceRepository extends BaseRepository
|
||||||
// 获取当前用户的员工信息
|
// 获取当前用户的员工信息
|
||||||
public function getServices($uid, array $where = [],$is_sys = 1){
|
public function getServices($uid, array $where = [],$is_sys = 1){
|
||||||
// $where['uid'] = $uid;
|
// $where['uid'] = $uid;
|
||||||
// 商户类别(merchant_type):0=普通商户,1=酒道馆,2=供应商
|
// 商户类别(merchant_type):0=普通商户,1=酒道馆,2=供应商,3=烟酒店
|
||||||
// is_sys:0=商户管理,1=平台管理,2=酒道馆管理
|
// is_sys:0=商户管理,1=平台管理,2=酒道馆管理,3=烟酒店
|
||||||
$list = $this->dao->getSearch([])
|
$list = $this->dao->getSearch([])
|
||||||
->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where, $is_sys, $uid){
|
->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where, $is_sys, $uid){
|
||||||
// 存在指定商户ID 并且为酒道馆
|
// 存在指定商户ID 并且为酒道馆
|
||||||
|
|
@ -214,7 +214,12 @@ class StoreServiceRepository extends BaseRepository
|
||||||
},function($query) use ($is_sys, $uid){
|
},function($query) use ($is_sys, $uid){
|
||||||
// 不存在指定商户id
|
// 不存在指定商户id
|
||||||
$query->hasWhere('merchant',function($query) use ($is_sys){
|
$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.mer_id',$is_sys == 1 ? '=' : '>',0)
|
||||||
->where('StoreService.uid',$uid);
|
->where('StoreService.uid',$uid);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue