交期

parent cb50a0de
Showing with 12 additions and 2 deletions
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gomodule/redigo/redis" "github.com/gomodule/redigo/redis"
"github.com/imroc/req" "github.com/imroc/req"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"search_server/model" "search_server/model"
"search_server/pkg/common" "search_server/pkg/common"
...@@ -67,6 +68,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good ...@@ -67,6 +68,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
return return
} }
goodsListMap = make(map[string]model.ApiGoods, 1000) goodsListMap = make(map[string]model.ApiGoods, 1000)
dayFilter := []string{"工作日", "个工作日", "日", "个"}
//先判断返回的data是不是字典,不是字典代表可能是返回字符串了 //先判断返回的data是不是字典,不是字典代表可能是返回字符串了
if gjson.Get(resp.String(), "data").IsObject() { if gjson.Get(resp.String(), "data").IsObject() {
//排序操作 //排序操作
...@@ -97,6 +100,13 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good ...@@ -97,6 +100,13 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
"sign": gjson.Get(ActivityInfoStr, "sign").String(), "sign": gjson.Get(ActivityInfoStr, "sign").String(),
"show_name": gjson.Get(ActivityInfoStr, "show_name").String(), "show_name": gjson.Get(ActivityInfoStr, "show_name").String(),
} }
hk_delivery_time := data.Get("hk_delivery_time").String()
cn_delivery_time := data.Get("cn_delivery_time").String()
for _, v := range dayFilter {
hk_delivery_time = php2go.StrReplace(v, "", hk_delivery_time, 1)
cn_delivery_time = php2go.StrReplace(v, "", cn_delivery_time, 1)
}
goods.ActivityInfo = ActivityInfo goods.ActivityInfo = ActivityInfo
goods.StandardBrandName = "" goods.StandardBrandName = ""
...@@ -115,8 +125,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good ...@@ -115,8 +125,8 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
goods.MoqStr = int(data.Get("moq").Int()) goods.MoqStr = int(data.Get("moq").Int())
goods.Stock = int(data.Get("stock").Int()) goods.Stock = int(data.Get("stock").Int())
goods.StockStr = int(data.Get("stock").Int()) goods.StockStr = int(data.Get("stock").Int())
goods.HkDeliveryTime = data.Get("hk_delivery_time").String() goods.HkDeliveryTime = hk_delivery_time
goods.CnDeliveryTime = data.Get("cn_delivery_time").String() goods.CnDeliveryTime = cn_delivery_time
goods.BrandName = data.Get("brand_name").String() goods.BrandName = data.Get("brand_name").String()
goods.SupplierName = data.Get("supplier_name").String() goods.SupplierName = data.Get("supplier_name").String()
goods.BrandId = int(data.Get("brand_id").Int()) goods.BrandId = int(data.Get("brand_id").Int())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment