Commit af89d701 by 杨树贤

修复冲突

parent 9080f2f7
package _map
package enum
//品牌简写替换
var SelfBrandReplace = map[string]string{
......
package logic
import (
"LC_soapi/enum"
"LC_soapi/pkg/es"
"LC_soapi/pkg/setting"
"fmt"
......@@ -69,19 +70,19 @@ func getESParams(params SearchParams) (esParams ESParams) {
goodsNameUpper := strings.ToUpper(params.GoodsName)
//精确匹配的型号列表
if php2go.InArray(goodsNameUpper, setting.MathExactGoodsName) {
if php2go.InArray(goodsNameUpper, enum.MathExactGoodsName) {
termQuery := elastic.NewTermQuery("auto_goods_name.raw", goodsNameUpper)
esQuery = elastic.NewBoolQuery().Must(termQuery)
}
}
fmt.Println(upperField, intField, goodsTempStatus,esQuery)
fmt.Println(upperField, intField, goodsTempStatus, esQuery)
return esParams
}
//转换商品名称
func transformGoodsName(goodsName string) string {
//正则处理
for key, value := range setting.SearchKeywordMapping {
for key, value := range enum.SearchKeywordMapping {
reg, _ := regexp.Compile(key)
goodsName = reg.ReplaceAllString(goodsName, value)
}
......@@ -92,7 +93,7 @@ func transformGoodsName(goodsName string) string {
func getGoodsNameSlice(goodsName string) (goodsNameSlice []string) {
//判断是否存在于品牌中,如果存在,则转换成品牌数据
if goodsName != "" {
brandName := setting.SelfBrandReplace[strings.ToUpper(goodsName)]
brandName := enum.SelfBrandReplace[strings.ToUpper(goodsName)]
if brandName != "" {
goodsNameSlice = append(goodsNameSlice, brandName)
return goodsNameSlice
......
package http
import (
"LC_soapi/logic"
"LC_soapi/pkg/app"
"LC_soapi/service"
"github.com/gin-gonic/gin"
)
......
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