修复:商户登录后无任何操作权限
This commit is contained in:
parent
583f18cba9
commit
6e0fcbd49c
|
|
@ -189,14 +189,18 @@ 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;
|
||||||
|
// 商户类别:0=普通商户,1=酒道馆,2=供应商
|
||||||
$list = $this->dao->getSearch([])
|
$list = $this->dao->getSearch([])
|
||||||
->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where){
|
->when(isset($where['appoint_mer_id']) && $where['appoint_mer_id'] !== '',function($query) use ($where, $is_sys, $uid){
|
||||||
// 存在指定商户ID
|
// 存在指定商户ID 并且为酒道馆
|
||||||
$query->hasWhere('merchant',function($query){
|
$query->hasWhere('merchant',function($query){
|
||||||
$query->where('is_del', 0);
|
$query->where('is_del', 0);
|
||||||
})->where('StoreService.mer_id', $where['appoint_mer_id'])
|
})->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){
|
},function($query) use ($is_sys, $uid){
|
||||||
// 不存在指定商户id
|
// 不存在指定商户id
|
||||||
$query->hasWhere('merchant',function($query) use ($is_sys){
|
$query->hasWhere('merchant',function($query) use ($is_sys){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue