feature: 组筛选

This commit is contained in:
zhuyu 2025-06-24 17:59:12 +08:00
parent b3aaff2238
commit 81bc56f571
4 changed files with 62 additions and 6 deletions

View File

@ -98,12 +98,24 @@ class Admin extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->where($where)
->where('id', 'in', $this->childrenAdminIds)
->field(['password', 'salt', 'token'], true)
->order($sort, $order)
->paginate($limit);
$filter = $this->request->param('filter');
$filter = json_decode($filter, true);
if (isset($filter['group_id'])) {
$list = $this->model
->join('fa_auth_group_access fg', 'fg.uid = fa_admin.id')
->where($where)
->where('id', 'in', $this->childrenAdminIds)
->field(['password', 'salt', 'token'], true)
->order($sort, $order)
->paginate($limit);
} else {
$list = $this->model
->where($where)
->where('id', 'in', $this->childrenAdminIds)
->field(['password', 'salt', 'token'], true)
->order($sort, $order)
->paginate($limit);
}
foreach ($list as $k => &$v) {
$groups = isset($adminGroupName[$v['id']]) ? $adminGroupName[$v['id']] : [];

View File

@ -82,6 +82,12 @@ class Group extends Backend
return $this->view->fetch();
}
public function norightselectpage()
{
$this->dataLimit = null;
return parent::selectpage();
}
/**
* 添加
*/

View File

@ -19,3 +19,39 @@
</div>
</div>
</div>
<script id="customformtpl" type="text/html">
<!--form表单必须添加form-commsearch这个类-->
<form action="" class="form-commonsearch">
<div style="border-radius:2px;margin-bottom:10px;background:#f5f5f5;padding:15px 20px;">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-3" style="min-height:68px;">
<div class="form-group">
<label class="control-label">所属组别</label>
<input type="hidden" class="operate" data-name="group_id" value="in"/>
<div>
<input
type="text"
class="form-control selectpage"
name="group_id"
data-source="auth/group/norightselectpage"
data-field="name"
data-primary-key="id"
data-multiple="true"
/>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="form-group">
<label class="control-label"></label>
<div class="row">
<div class="col-xs-6">
<input type="submit" class="btn btn-success btn-block" value="查询"/>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</script>

View File

@ -43,6 +43,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'],
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
searchFormVisible: true,
searchFormTemplate: 'customformtpl',
columns: [
[
{field: 'state', checkbox: true,},