Commit 15cfd232 by huangchengyi

1.0

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