修改考试设置表格
This commit is contained in:
1 parent
acd4180181
commit
a30ed5b256
146 files changed
+3216
-2782
No files matched your search
@@ -30,7 +30,7 @@ class AuthRule extends Base
|
||||
|
||||
// 查询数据
|
||||
$data = $this
|
||||
->order([$src['field'] =>$src['type']])
|
||||
->order([$src['field'] =>$src['order']])
|
||||
->when(strlen($searchval)>0,function($query) use($searchval){
|
||||
$query->where('title|name','like','%'.$searchval.'%');
|
||||
})
|
||||
@@ -40,4 +40,38 @@ class AuthRule extends Base
|
||||
->select();
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
// 递归权限
|
||||
public function srcChildren($arr=array())
|
||||
{
|
||||
if(count($arr)==0 && $pid==0)
|
||||
{
|
||||
$arr = $this->where('pid',0)
|
||||
->where('status',1)
|
||||
->field('id,name,title,condition,paixu,ismenu,url,pid,type')
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
$getArr = array();
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
$temp = $this->where('pid',$value['pid'])
|
||||
->where('status',1)
|
||||
->field('id,name,title,condition,paixu,ismenu,url,pid,type')
|
||||
->select()
|
||||
->toArray();
|
||||
if(count($temp)>0)
|
||||
{
|
||||
// $getArr['pid'] = $this->srcChildren($temp,$value['pid']);
|
||||
}else{
|
||||
// $getArr['pid'] = $temp;
|
||||
}
|
||||
}
|
||||
|
||||
$getArr[$value['pid']] = $temp;
|
||||
|
||||
return $getArr;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user