sth
This commit is contained in:
parent
08459b02df
commit
2be096d0fe
|
|
@ -62,7 +62,7 @@ class Configorder extends Backend
|
|||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
$list = $this->model
|
||||
->tab(Order::TAB_SETTING)
|
||||
->configauth($this->auth,'dispatch_admin_id')
|
||||
->dispatcherauth($this->auth,'dispatch_admin_id')
|
||||
//->areaauth($this->auth)
|
||||
->with(['dispatchadmin'])
|
||||
->where($where);
|
||||
|
|
|
|||
|
|
@ -617,14 +617,10 @@ class Auth extends \fast\Auth
|
|||
* @param $uid
|
||||
* @return bool
|
||||
*/
|
||||
public function isAdminGroup($uid = null){
|
||||
$adminGroupIds = [1,11];
|
||||
public function isDispatcher($uid = null){
|
||||
$dispatcherGroupId = 6;
|
||||
$groupIds = $this->getGroupIds($uid);
|
||||
$adminGroupIds = array_intersect($groupIds,$adminGroupIds);
|
||||
if(!empty($adminGroupIds)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return in_array($dispatcherGroupId,$groupIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,9 +248,9 @@ class Order extends Model
|
|||
return $query;
|
||||
}
|
||||
|
||||
public function scopeConfigauth($query, Auth $auth, string $admin_id_field='admin_id'){
|
||||
public function scopeDispatcherauth($query, Auth $auth, string $admin_id_field='admin_id'){
|
||||
|
||||
if(!$auth->isAdminGroup()){
|
||||
if($auth->isDispatcher()){ //是派单员
|
||||
$query->where('fa_order.'.$admin_id_field,$auth->id);
|
||||
}
|
||||
return $query;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user