|
@@ -68,14 +68,27 @@ class Ghuser extends Backend
|
|
|
}
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
|
|
|
+ //公会分权限
|
|
|
+ $gh_map = [];
|
|
|
+ $gh_ids = db('admin')->where('id',$this->auth->id)->value('gh_ids');
|
|
|
+ if(empty($gh_ids)){
|
|
|
+ $gh_map = ['ghuser.gh_id' => '-1'];
|
|
|
+ }else{
|
|
|
+ $gh_map = ['ghuser.gh_id' => ['IN',$gh_ids]];
|
|
|
+ }
|
|
|
+ if($gh_ids == '*'){
|
|
|
+ $gh_map = [];
|
|
|
+ }
|
|
|
+
|
|
|
$list = $this->model
|
|
|
->with(['gonghui'])
|
|
|
->where($where)
|
|
|
+ ->where($gh_map)
|
|
|
->order($sort, $order)
|
|
|
+ // ->select(false);dump($list);exit;
|
|
|
->paginate($limit);
|
|
|
|
|
|
foreach ($list as $row) {
|
|
|
-
|
|
|
$row->getRelation('gonghui')->visible(['name']);
|
|
|
}
|
|
|
|