修改数量查询方法
This commit is contained in:
@@ -61,7 +61,7 @@ func GetExaCustomer(id uint) (err error, customer model.ExaCustomer) {
|
||||
func GetCustomerInfoList(sysUserAuthorityID string, info request.PageInfo) (err error, list interface{}, total int) {
|
||||
limit := info.PageSize
|
||||
offset := info.PageSize * (info.Page - 1)
|
||||
db := global.GVA_DB
|
||||
db := global.GVA_DB.Model(&model.SysAuthority{})
|
||||
var a model.SysAuthority
|
||||
a.AuthorityId = sysUserAuthorityID
|
||||
err, auth := GetAuthorityInfo(a)
|
||||
@@ -70,7 +70,7 @@ func GetCustomerInfoList(sysUserAuthorityID string, info request.PageInfo) (err
|
||||
dataId = append(dataId, v.AuthorityId)
|
||||
}
|
||||
var CustomerList []model.ExaCustomer
|
||||
err = db.Where("sys_user_authority_id in (?)", dataId).Find(&CustomerList).Count(&total).Error
|
||||
err = db.Where("sys_user_authority_id in (?)", dataId).Count(&total).Error
|
||||
if err != nil {
|
||||
return err, CustomerList, total
|
||||
} else {
|
||||
|
||||
@@ -49,7 +49,7 @@ func DeleteApi(api model.SysApi) (err error) {
|
||||
func GetAPIInfoList(api model.SysApi, info request.PageInfo, order string, desc bool) (err error, list interface{}, total int) {
|
||||
limit := info.PageSize
|
||||
offset := info.PageSize * (info.Page - 1)
|
||||
db := global.GVA_DB
|
||||
db := global.GVA_DB.Model(&model.SysApi{})
|
||||
var apiList []model.SysApi
|
||||
|
||||
if api.Path != "" {
|
||||
@@ -68,7 +68,7 @@ func GetAPIInfoList(api model.SysApi, info request.PageInfo, order string, desc
|
||||
db = db.Where("api_group = ?", api.ApiGroup)
|
||||
}
|
||||
|
||||
err = db.Find(&apiList).Count(&total).Error
|
||||
err = db.Count(&total).Error
|
||||
|
||||
if err != nil {
|
||||
return err, apiList, total
|
||||
|
||||
@@ -73,9 +73,9 @@ func ChangePassword(u *model.SysUser, newPassword string) (err error, userInter
|
||||
func GetUserInfoList(info request.PageInfo) (err error, list interface{}, total int) {
|
||||
limit := info.PageSize
|
||||
offset := info.PageSize * (info.Page - 1)
|
||||
db := global.GVA_DB
|
||||
db := global.GVA_DB.Model(&model.SysUser{})
|
||||
var userList []model.SysUser
|
||||
err = db.Find(&userList).Count(&total).Error
|
||||
err = db.Count(&total).Error
|
||||
err = db.Limit(limit).Offset(offset).Preload("Authority").Find(&userList).Error
|
||||
return err, userList, total
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user