This commit is contained in:
xman 2025-06-27 16:09:17 +08:00
parent 403ff850e8
commit 08459b02df
3 changed files with 31 additions and 3 deletions

View File

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

View File

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

View File

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