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($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
$list = $this->model
|
$list = $this->model
|
||||||
->tab(Order::TAB_SETTING)
|
->tab(Order::TAB_SETTING)
|
||||||
//->auth($this->auth,'dispatch_admin_id')
|
->configauth($this->auth,'dispatch_admin_id')
|
||||||
//->areaauth($this->auth)
|
//->areaauth($this->auth)
|
||||||
->with(['dispatchadmin'])
|
->with(['dispatchadmin'])
|
||||||
->where($where)
|
->where($where);
|
||||||
->order($sort, $order)
|
|
||||||
|
|
||||||
|
$list = $list->order($sort, $order)
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
|
|
||||||
foreach ($list as $row)
|
foreach ($list as $row)
|
||||||
|
|
|
||||||
|
|
@ -610,4 +610,21 @@ class Auth extends \fast\Auth
|
||||||
{
|
{
|
||||||
return $this->_error ? __($this->_error) : '';
|
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;
|
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
|
* @param $query
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user