From 9f0ceda3473d79c12e79e21ebc7bc6e44396b0dd Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 25 Aug 2020 23:07:34 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aadded=20file=20info=20pid=20search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/sysfileinfo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/sysfileinfo.go b/models/sysfileinfo.go index 5755afc3..88edc2fe 100644 --- a/models/sysfileinfo.go +++ b/models/sysfileinfo.go @@ -58,6 +58,10 @@ func (e *SysFileInfo) GetPage(pageSize int, pageIndex int) ([]SysFileInfo, int, table := orm.Eloquent.Select("*").Table(e.TableName()) + if e.PId != 0 { + table = table.Where("p_id = ?", e.PId) + } + // 数据权限控制(如果不需要数据权限请将此处去掉) dataPermission := new(DataPermission) dataPermission.UserId, _ = tools.StringToInt(e.DataScope)