Kaynağa Gözat

wip:页面数据调整

wangkaiyue 1 yıl önce
ebeveyn
işleme
98f1acf9ac

+ 1 - 1
internal/service/areaStruct.go

@@ -149,7 +149,7 @@ func (aRoot *AreaRoot) GetData(ctx context.Context, maxTotal int, query *SeoBidd
 	}
 
 	values = append(values, maxTotal+50)
-	queryRes, err := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.bid_id
+	queryRes, err := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.bid_id,b.seo_id
 			FROM jyseo.column_bidList b
 			WHERE 1=1 %s
 			ORDER BY b.publish_time DESC

+ 2 - 47
internal/service/queryStruct.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"github.com/gogf/gf/v2/container/gvar"
 	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
 	"github.com/gogf/gf/v2/util/gconv"
 	"jybxseo/internal/consts"
 	"jybxseo/utility"
@@ -86,7 +87,7 @@ func (query *SeoBiddingQuery) dataFormat(data []map[string]interface{}) (bList [
 		for _, v := range data {
 			bl := &InfoList{
 				Title:   gconv.String(v["title"]),
-				Url:     fmt.Sprintf("/jybx/{pushDate}_%s.html", gconv.String(v["seo_id"])),
+				Url:     fmt.Sprintf("/jybx/%s_%s.html", gtime.NewFromTimeStamp(gconv.Int64(v["publish_time"])).Format("20060102"), gconv.String(v["seo_id"])),
 				Area:    gconv.String(v["area"]),
 				City:    gconv.String(v["city"]),
 				Subtype: gconv.String(v["subtype"]),
@@ -238,49 +239,3 @@ func FillingBiddingBaseFields(ctx context.Context, res []map[string]interface{})
 	}
 	return finalArr
 }
-
-func FillingEsBiddingBaseFields(res []map[string]interface{}, key string) []map[string]interface{} {
-	bidMap := map[string]map[string]interface{}{}
-	for _, m := range res {
-		if bidIdStr := gconv.String(m["_id"]); bidIdStr != "" {
-			mv := make(map[string]interface{})
-			mv["keyword"] = key
-			if len([]rune(gconv.String(m["detail"]))) > 100 {
-				mv["desc"] = string([]rune(gconv.String(m["detail"]))[:100])
-			} else {
-				mv["desc"] = gconv.String(m["detail"])
-			}
-			mv["bid_id"] = bidIdStr
-			mv["title"] = gconv.String(m["title"])
-			mv["area"] = gconv.String(m["area"])
-			mv["city"] = gconv.String(m["city"])
-			mv["district"] = gconv.String(m["district"])
-			mv["toptype"] = gconv.String(m["toptype"])
-			mv["subtype"] = gconv.String(m["subtype"])
-			mv["industry"] = ""
-			if subs := gconv.String(m["s_subscopeclass"]); subs != "" {
-				classArr := strings.Split(strings.Split(subs, ",")[0], "_")
-				if len(classArr) == 2 {
-					mv["industry"] = classArr[0]
-				}
-			}
-			mv["bidamount"] = gconv.Float64(m["bidamount"])
-			mv["budget"] = gconv.Float64(m["budget"])
-			mv["size"] = gconv.String(m["size"])
-			mv["isValidFile"] = gconv.Bool(m["isValidFile"])
-			mv["publish_time"] = gconv.Int64(m["publishtime"])
-			bidMap[bidIdStr] = mv
-		}
-	}
-
-	var finalArr []map[string]interface{}
-	for i := 0; i < len(res); i++ {
-		if tBid := gconv.String(res[i]["_id"]); tBid != "" && bidMap[tBid] != nil && len(bidMap[tBid]) > 0 {
-			for k, v := range bidMap[tBid] {
-				res[i][k] = v
-			}
-			finalArr = append(finalArr, res[i])
-		}
-	}
-	return finalArr
-}

+ 1 - 1
manifest/config/global.yaml

@@ -1,7 +1,7 @@
 cdn: ""
 version: "1.0.2"
 webDomainFormat: "http://%s.myjy.cn"
-jyWebDomain: "https://www.jianyu.com"
+jyWebDomain: "https://www.jianyu360.cn"
 
 # 地区省份城市配置
 allAreaTree: