|
@@ -1,10 +1,13 @@
|
|
|
package logic
|
|
|
|
|
|
import (
|
|
|
- se "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
"context"
|
|
|
"jyInfo/rpc/model/es"
|
|
|
"log"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
+
|
|
|
+ se "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
|
|
|
"jyInfo/rpc/consumer/consumer"
|
|
|
"jyInfo/rpc/consumer/internal/svc"
|
|
@@ -29,6 +32,18 @@ func NewSupplyInfoSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
|
|
|
|
|
|
// 供应信息查询
|
|
|
func (l *SupplyInfoSearchLogic) SupplyInfoSearch(in *consumer.SupplyInfoSearchReq) (*consumer.SupplyInfoSearchResp, error) {
|
|
|
+ //默认每页五十条
|
|
|
+ if in.PageSize == 0 {
|
|
|
+ in.PageSize = 50
|
|
|
+ }
|
|
|
+ //默认第一页
|
|
|
+ if in.PageIndex == 0 {
|
|
|
+ in.PageIndex = 1
|
|
|
+ }
|
|
|
+ //空格多个关键词
|
|
|
+ if strings.Contains(in.Keywords, "+") {
|
|
|
+ in.Keywords = strings.ReplaceAll(in.Keywords, " ", "+")
|
|
|
+ }
|
|
|
list, total := model.GetSupplyInfoList(in)
|
|
|
var infos []*consumer.SupplyList
|
|
|
if len(*list) > 0 {
|
|
@@ -46,7 +61,7 @@ func (l *SupplyInfoSearchLogic) SupplyInfoSearch(in *consumer.SupplyInfoSearchRe
|
|
|
Id: se.SE.EncodeString(common.InterfaceToStr(v["_id"])),
|
|
|
Province: common.InterfaceToStr(v["province"]),
|
|
|
City: common.InterfaceToStr(v["city"]),
|
|
|
- PublishTime: common.InterfaceToStr(v["publish_time"]),
|
|
|
+ PublishTime: strconv.FormatInt(common.Int64All(v["publish_time"]), 10),
|
|
|
Highlight: detail,
|
|
|
}
|
|
|
infos = append(infos, &info)
|