Browse Source

修复total返回为0的bug

main
pixel 5 years ago
parent
commit
2580a3dbea
  1. 1
      server/service/exa_file_upload_download.go
  2. 1
      server/service/sys_user.go

1
server/service/exa_file_upload_download.go

@ -53,6 +53,7 @@ func GetFileRecordInfoList(info request.PageInfo) (err error, list interface{},
offset := info.PageSize * (info.Page - 1)
db := global.GVA_DB
var fileLists []model.ExaFileUploadAndDownload
err = db.Find(&fileLists).Count(&total).Error
err = db.Limit(limit).Offset(offset).Order("updated_at desc").Find(&fileLists).Error
return err, fileLists, total
}

1
server/service/sys_user.go

@ -79,6 +79,7 @@ func GetUserInfoList(info request.PageInfo) (err error, list interface{}, total
offset := info.PageSize * (info.Page - 1)
db := global.GVA_DB
var userList []model.SysUser
err = db.Find(&userList).Count(&total).Error
err = db.Limit(limit).Offset(offset).Preload("Authority").Find(&userList).Error
return err, userList, total
}

Loading…
Cancel
Save