修复:商户登录后无任何操作权限

This commit is contained in:
wuhui_zzw 2024-03-04 13:07:25 +08:00
parent 583f18cba9
commit 6e0fcbd49c
1 changed files with 8 additions and 4 deletions

View File

@ -189,14 +189,18 @@ class StoreServiceRepository extends BaseRepository
// 获取当前用户的员工信息
public function getServices($uid, array $where = [],$is_sys = 1){
// $where['uid'] = $uid;
// 商户类别0=普通商户1=酒道馆2=供应商
$list = $this->dao->getSearch([])
->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where){
// 存在指定商户ID
->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where, $is_sys, $uid){
// 存在指定商户ID 并且为酒道馆
$query->hasWhere('merchant',function($query){
$query->where('is_del', 0);
})->where('StoreService.mer_id', $where['appoint_mer_id'])
->where('StoreService.is_manage', 1);
->when($is_sys == 1,function($query){
$query->where('StoreService.is_manage', 1);
},function($query) use ($uid){
$query->where('StoreService.uid',$uid);
});
},function($query) use ($is_sys, $uid){
// 不存在指定商户id
$query->hasWhere('merchant',function($query) use ($is_sys){