|
@@ -32,10 +32,6 @@ func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerList
|
|
resp := &bxbuyer.BuyerListResp{
|
|
resp := &bxbuyer.BuyerListResp{
|
|
Data: &bxbuyer.BuyerData{},
|
|
Data: &bxbuyer.BuyerData{},
|
|
}
|
|
}
|
|
- // 采购单位搜索过来的 最多查100条
|
|
|
|
- if in.PageSize*in.PageNum > IC.C.BuyerSearchLimit {
|
|
|
|
- in.PageNum = IC.C.BuyerSearchLimit / in.PageSize
|
|
|
|
- }
|
|
|
|
if in.PageNum < 1 {
|
|
if in.PageNum < 1 {
|
|
in.PageNum = 1
|
|
in.PageNum = 1
|
|
}
|
|
}
|
|
@@ -45,6 +41,12 @@ func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerList
|
|
if in.PageSize > IC.C.BuyerSearchLimit {
|
|
if in.PageSize > IC.C.BuyerSearchLimit {
|
|
in.PageSize = IC.C.BuyerSearchLimit
|
|
in.PageSize = IC.C.BuyerSearchLimit
|
|
}
|
|
}
|
|
|
|
+ // 判断数量
|
|
|
|
+ // 采购单位搜索过来的 最多查BuyerSearchLimit条
|
|
|
|
+ if in.PageNum*in.PageSize > IC.C.BuyerSearchLimit && (in.PageNum-1)*in.PageSize >= IC.C.BuyerSearchLimit {
|
|
|
|
+ in.PageNum = IC.C.BuyerSearchLimit / in.PageSize
|
|
|
|
+ }
|
|
|
|
+
|
|
query, CountQuery := "", ""
|
|
query, CountQuery := "", ""
|
|
buyerNames := []string{}
|
|
buyerNames := []string{}
|
|
if model.CheckEmpty(in) {
|
|
if model.CheckEmpty(in) {
|
|
@@ -88,6 +90,14 @@ func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerList
|
|
if len(resp.Data.List) > 0 && (in.UserId != "" || in.EntUserId != "") {
|
|
if len(resp.Data.List) > 0 && (in.UserId != "" || in.EntUserId != "") {
|
|
model.SupplyFollowInfo(in, buyerNames, resp)
|
|
model.SupplyFollowInfo(in, buyerNames, resp)
|
|
}
|
|
}
|
|
|
|
+ if len(resp.Data.List) > 0 {
|
|
|
|
+ if in.PageNum*in.PageSize > IC.C.BuyerSearchLimit && (in.PageNum-1)*in.PageSize < IC.C.BuyerSearchLimit {
|
|
|
|
+ end := IC.C.BuyerSearchLimit - (in.PageNum-1)*in.PageSize
|
|
|
|
+ if len(resp.Data.List) > int(end) {
|
|
|
|
+ resp.Data.List = resp.Data.List[:end]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if resp.Data.Count > IC.C.BuyerSearchLimit {
|
|
if resp.Data.Count > IC.C.BuyerSearchLimit {
|
|
resp.Data.Count = IC.C.BuyerSearchLimit
|
|
resp.Data.Count = IC.C.BuyerSearchLimit
|
|
}
|
|
}
|