sth
This commit is contained in:
parent
403ff850e8
commit
08459b02df
|
|
@ -62,11 +62,13 @@ class Configorder extends Backend
|
|||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
$list = $this->model
|
||||
->tab(Order::TAB_SETTING)
|
||||
//->auth($this->auth,'dispatch_admin_id')
|
||||
->configauth($this->auth,'dispatch_admin_id')
|
||||
//->areaauth($this->auth)
|
||||
->with(['dispatchadmin'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->where($where);
|
||||
|
||||
|
||||
$list = $list->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row)
|
||||
|
|
|
|||
|
|
@ -610,4 +610,21 @@ class Auth extends \fast\Auth
|
|||
{
|
||||
return $this->_error ? __($this->_error) : '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否是管理组
|
||||
* @param $uid
|
||||
* @return bool
|
||||
*/
|
||||
public function isAdminGroup($uid = null){
|
||||
$adminGroupIds = [1,11];
|
||||
$groupIds = $this->getGroupIds($uid);
|
||||
$adminGroupIds = array_intersect($groupIds,$adminGroupIds);
|
||||
if(!empty($adminGroupIds)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,6 +248,15 @@ class Order extends Model
|
|||
return $query;
|
||||
}
|
||||
|
||||
public function scopeConfigauth($query, Auth $auth, string $admin_id_field='admin_id'){
|
||||
|
||||
if(!$auth->isAdminGroup()){
|
||||
$query->where('fa_order.'.$admin_id_field,$auth->id);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 地域权限
|
||||
* @param $query
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user