Commit 9b0a7ad1 by mushishixian

修复

parent 6220f235
...@@ -220,7 +220,7 @@ func GetGoodsBySupplier(r requests.QuoteIndexRequest) (result map[string]interfa ...@@ -220,7 +220,7 @@ func GetGoodsBySupplier(r requests.QuoteIndexRequest) (result map[string]interfa
return return
} }
goodsList, err := GetGoodsInfo(goodsIds, 0) goodsList, err := GetGoodsInfo(goodsIds, 0)
dullData, err := transformer.DullDataInfo(r, goodsList) dullData, err := transformer.DullDataInfo(r.Keyword, goodsList)
result = make(map[string]interface{}) result = make(map[string]interface{})
result["data"] = dullData result["data"] = dullData
result["total"] = gjson.Get(res, "hits.total").Int() result["total"] = gjson.Get(res, "hits.total").Int()
......
...@@ -9,12 +9,11 @@ import ( ...@@ -9,12 +9,11 @@ import (
"search_server/pkg/common" "search_server/pkg/common"
"search_server/pkg/config" "search_server/pkg/config"
"search_server/pkg/gredis" "search_server/pkg/gredis"
"search_server/requests"
"strings" "strings"
) )
//处理商品信息数据 //处理商品信息数据
func DullDataInfo(r requests.QuoteIndexRequest, goodsListMap map[string]model.ApiGoods) (result []model.DullGoodsData, err error) { func DullDataInfo(keyword string, goodsListMap map[string]model.ApiGoods) (result []model.DullGoodsData, err error) {
//获取redis链接 //获取redis链接
redisCon := gredis.Conn("search_r") redisCon := gredis.Conn("search_r")
defer redisCon.Close() defer redisCon.Close()
...@@ -25,7 +24,7 @@ func DullDataInfo(r requests.QuoteIndexRequest, goodsListMap map[string]model.Ap ...@@ -25,7 +24,7 @@ func DullDataInfo(r requests.QuoteIndexRequest, goodsListMap map[string]model.Ap
goods.GoodsName = goods.SpuName goods.GoodsName = goods.SpuName
} }
//获取goods_temp_name字段 //获取goods_temp_name字段
goods = getGoodsTempName(r.Keyword, goods) goods = getGoodsTempName(keyword, goods)
//获取tes广告 //获取tes广告
goods = getTesAd(goods) goods = getTesAd(goods)
//供应商信息,读取redis,来源于基石配置 //供应商信息,读取redis,来源于基石配置
...@@ -50,14 +49,14 @@ func DullDataInfo(r requests.QuoteIndexRequest, goodsListMap map[string]model.Ap ...@@ -50,14 +49,14 @@ func DullDataInfo(r requests.QuoteIndexRequest, goodsListMap map[string]model.Ap
//todo : showsku方法 //todo : showsku方法
//价格等信息混淆 //价格等信息混淆
if r.Keyword != "---" { if keyword != "---" {
goods, err = MetGoodsInfo(goods) goods, err = MetGoodsInfo(goods)
if err != nil { if err != nil {
return result, err return result, err
} }
} }
//增加类似物料字段 //增加类似物料字段
goods = getGoodsAlike(r.Keyword, goods) goods = getGoodsAlike(keyword, goods)
result = append(result, goods) result = append(result, goods)
} }
return return
......
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