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($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model $list = $this->model
->tab(Order::TAB_SETTING) ->tab(Order::TAB_SETTING)
->configauth($this->auth,'dispatch_admin_id') ->dispatcherauth($this->auth,'dispatch_admin_id')
//->areaauth($this->auth) //->areaauth($this->auth)
->with(['dispatchadmin']) ->with(['dispatchadmin'])
->where($where); ->where($where);

View File

@ -617,14 +617,10 @@ class Auth extends \fast\Auth
* @param $uid * @param $uid
* @return bool * @return bool
*/ */
public function isAdminGroup($uid = null){ public function isDispatcher($uid = null){
$adminGroupIds = [1,11]; $dispatcherGroupId = 6;
$groupIds = $this->getGroupIds($uid); $groupIds = $this->getGroupIds($uid);
$adminGroupIds = array_intersect($groupIds,$adminGroupIds); return in_array($dispatcherGroupId,$groupIds);
if(!empty($adminGroupIds)){
return false;
}
return true;
} }
} }

View File

@ -248,9 +248,9 @@ class Order extends Model
return $query; 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); $query->where('fa_order.'.$admin_id_field,$auth->id);
} }
return $query; return $query;