修复:店铺关闭后或者店员状态关闭后移动端管理入口依然存在
This commit is contained in:
parent
d79a768eb1
commit
8c8eb991fb
|
|
@ -189,18 +189,43 @@ class User extends BaseModel
|
|||
|
||||
public function service()
|
||||
{
|
||||
return $this->hasOne(StoreService::class, 'uid', 'uid')
|
||||
->where('mer_id', '<>', 0)
|
||||
->where('is_del', 0)
|
||||
->where('is_open', 1)
|
||||
return $this->hasOne(StoreService::class,'uid','uid')
|
||||
->where('mer_id','<>',0)
|
||||
->where('is_del',0)
|
||||
->where('is_open',1)
|
||||
->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods,is_open')
|
||||
->order('is_verify DESC,customer DESC');
|
||||
}
|
||||
|
||||
// 用户是否存在商户平台 有效店员信息
|
||||
public function getServiceAttr($value){
|
||||
$info = (new StoreService())
|
||||
->field('service_id,uid,nickname,avatar,customer,StoreService.mer_id,is_verify,is_goods,is_open')
|
||||
->hasWhere('merchant',function($query){
|
||||
$query->where('is_del', 0)
|
||||
->where('mer_state', 1)
|
||||
->where('status', 1);
|
||||
})
|
||||
->where('uid',$this->uid)
|
||||
->where('StoreService.mer_id','<>',0)
|
||||
->where('StoreService.is_del',0)
|
||||
->where('is_open',1)
|
||||
->order('StoreService.is_verify DESC,StoreService.customer DESC')
|
||||
// ->fetchSql()
|
||||
->find();
|
||||
|
||||
return !empty($info) ? $info->toArray() : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function topService()
|
||||
{
|
||||
return $this->hasOne(StoreService::class, 'uid', 'uid')
|
||||
->where('mer_id', 0)->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods')->where('is_del', 0)
|
||||
->field('service_id,uid,nickname,avatar,customer,mer_id,is_verify,is_goods')
|
||||
->where('mer_id', 0)
|
||||
->where('is_del', 0)
|
||||
->where('is_open',1)
|
||||
->order('is_verify DESC,customer DESC');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ class StoreService extends BaseController
|
|||
'is_verify',
|
||||
'is_goods',
|
||||
'is_user',
|
||||
'staff_manage',
|
||||
'notify',
|
||||
'avatar',
|
||||
'phone',
|
||||
|
|
|
|||
Loading…
Reference in New Issue