Commit 15cfd232 by huangchengyi

1.0

parent c94f6e6b
......@@ -2,10 +2,7 @@ package controller
import (
"github.com/gin-gonic/gin"
"search_server/model"
"search_server/pkg/common"
"search_server/service"
"search_server/service/ly"
)
/*
......@@ -17,9 +14,9 @@ import (
func GetParityData(ctx *gin.Context) {
common.PrintDebugHeader(ctx) //debug
//调外链拿数据
optimumservice := service.OptimumService{}
apiData := optimumservice.GetOptimumAttr(ctx)
common.PrintDebugHtml(ctx,"-----执行结束----") //debug
common.Output(ctx,errCode, "查询成功", "")
//optimumservice := service.OptimumService{}
//apiData := optimumservice.GetOptimumAttr(ctx)
//
//common.PrintDebugHtml(ctx,"-----执行结束----") //debug
//common.Output(ctx,errCode, "查询成功", "")
}
......@@ -228,6 +228,7 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
GoodsUrl := ""
BrandUrl := ""
Multiple := 0
referer := ctx.GetHeader("Referer")
if referer != ""{
dome := strings.Split(referer,".com")
......@@ -238,6 +239,11 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
}else{
GoodsUrl = dome[0]+".com/goods_"+v.GoodsId+".html"
BrandUrl = dome[0]+".com/v3/brand/list/"+strconv.Itoa(v.BrandId)+".html"
//联营倍数
Multiple = v.Mpq
if v.Mpq > v.Moq {
Multiple = v.Moq
}
}
}
}
......@@ -247,6 +253,7 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
GoodsUrl: GoodsUrl,
BrandUrl: BrandUrl,
Attrs: attrs[v.GoodsId],
MultipleStr:Multiple,
})
}
......
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