This commit is contained in:
xman 2025-06-27 16:25:42 +08:00
parent 08459b02df
commit 2be096d0fe
3 changed files with 6 additions and 10 deletions

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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;