|
@@ -54,12 +54,20 @@ func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerList
|
|
|
if err := json.Unmarshal(*bs, &resp.Data); err != nil {
|
|
|
isBool = true
|
|
|
logx.Info("获取redis缓存,序列化异常")
|
|
|
+ } else {
|
|
|
+ if len(resp.Data.List) > 0 {
|
|
|
+ for i := 0; i < len(resp.Data.List); i++ {
|
|
|
+ buyerNames = append(buyerNames, resp.Data.List[i].Buyer)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
if isBool {
|
|
|
query, CountQuery = model.BuyerListRedisCacheQuery(in.PageNum, in.PageSize)
|
|
|
buyerNames, resp = model.GetBuyerList(query, CountQuery, true)
|
|
|
if len(resp.Data.List) > 0 {
|
|
|
+ model.SupplyBuyerListData(buyerNames, resp)
|
|
|
b, err := json.Marshal(resp.Data)
|
|
|
if err == nil {
|
|
|
redis.PutBytes("other", fmt.Sprintf(model.P_redis_key, in.PageNum, in.PageSize), &b, model.P_redis_time)
|
|
@@ -72,10 +80,12 @@ func (l *BuyerListLogic) BuyerList(in *bxbuyer.BuyerListReq) (*bxbuyer.BuyerList
|
|
|
query, CountQuery = model.BuyerListQuery(in)
|
|
|
logx.Info("query:", query)
|
|
|
buyerNames, resp = model.GetBuyerList(query, CountQuery, false) // 查询数据
|
|
|
+ if len(resp.Data.List) > 0 {
|
|
|
+ model.SupplyBuyerListData(buyerNames, resp)
|
|
|
+ }
|
|
|
}
|
|
|
- if len(resp.Data.List) > 0 {
|
|
|
+ if len(resp.Data.List) > 0 && (in.UserId != "" || in.EntUserId != "") {
|
|
|
model.SupplyFollowInfo(in, buyerNames, resp)
|
|
|
- model.SupplyBuyerListData(buyerNames, resp)
|
|
|
}
|
|
|
if resp.Data.Count > IC.C.BuyerSearchLimit {
|
|
|
resp.Data.Count = IC.C.BuyerSearchLimit
|