消除冗余代码 细节提示修复

This commit is contained in:
pixel
2020-04-09 12:03:29 +08:00
parent 3a778ccdf1
commit 6f3e3188b2
7 changed files with 64 additions and 89 deletions
+6 -10
View File
@@ -60,18 +60,14 @@ func GetAuthorityInfoList(info request.PageInfo) (err error, list interface{}, t
limit := info.PageSize
offset := info.PageSize * (info.Page - 1)
db := global.GVA_DB
if err != nil {
return
} else {
var authority []model.SysAuthority
err = db.Limit(limit).Offset(offset).Preload("DataAuthorityId").Where("parent_id = 0").Find(&authority).Error
if len(authority) > 0 {
for k, _ := range authority {
err = findChildrenAuthority(&authority[k])
}
var authority []model.SysAuthority
err = db.Limit(limit).Offset(offset).Preload("DataAuthorityId").Where("parent_id = 0").Find(&authority).Error
if len(authority) > 0 {
for k, _ := range authority {
err = findChildrenAuthority(&authority[k])
}
return err, authority, total
}
return err, authority, total
}
// @title GetAuthorityInfo