We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9307d08 commit 2e6f99eCopy full SHA for 2e6f99e
server/service/system/sys_authority.go
@@ -148,7 +148,9 @@ func (authorityService *AuthorityService) GetAuthorityInfoList(info request.Page
148
limit := info.PageSize
149
offset := info.PageSize * (info.Page - 1)
150
db := global.GVA_DB.Model(&system.SysAuthority{})
151
- err = db.Where("parent_id = ?", "0").Count(&total).Error
+ if err = db.Where("parent_id = ?", "0").Count(&total).Error; total == 0 || err != nil {
152
+ return
153
+ }
154
var authority []system.SysAuthority
155
err = db.Limit(limit).Offset(offset).Preload("DataAuthorityId").Where("parent_id = ?", "0").Find(&authority).Error
156
if len(authority) > 0 {
0 commit comments