|
@ -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) { |
|
|
func GetCustomerInfoList(sysUserAuthorityID string, info request.PageInfo) (err error, list interface{}, total int) { |
|
|
limit := info.PageSize |
|
|
limit := info.PageSize |
|
|
offset := info.PageSize * (info.Page - 1) |
|
|
offset := info.PageSize * (info.Page - 1) |
|
|
db := global.GVA_DB |
|
|
|
|
|
|
|
|
db := global.GVA_DB.Model(&model.SysAuthority{}) |
|
|
var a model.SysAuthority |
|
|
var a model.SysAuthority |
|
|
a.AuthorityId = sysUserAuthorityID |
|
|
a.AuthorityId = sysUserAuthorityID |
|
|
err, auth := GetAuthorityInfo(a) |
|
|
err, auth := GetAuthorityInfo(a) |
|
@ -70,7 +70,7 @@ func GetCustomerInfoList(sysUserAuthorityID string, info request.PageInfo) (err |
|
|
dataId = append(dataId, v.AuthorityId) |
|
|
dataId = append(dataId, v.AuthorityId) |
|
|
} |
|
|
} |
|
|
var CustomerList []model.ExaCustomer |
|
|
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 { |
|
|
if err != nil { |
|
|
return err, CustomerList, total |
|
|
return err, CustomerList, total |
|
|
} else { |
|
|
} else { |
|
|