Commit af89d701 by 杨树贤

修复冲突

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