标准品牌

parent c6b75300
......@@ -14,6 +14,7 @@ type ApiGoods struct {
Mpq int `json:"-"`
MpqStr interface{} `json:"mpq"`
Mpl int `json:"-"`
StandardBrand string `json:"standard_brand"`
StandardBrandName string `json:"standard_brand_name"`
StandardBrandUrl string `json:"standard_brand_url"`
MplStr interface{} `json:"mpl,omitempty"`
......
......@@ -115,6 +115,7 @@ func CurlGoodsInfo(ctx *gin.Context, goodsIdsStr string, params req.Param) (good
goods.GoodsUnit = data.Get("goods_unit").String()
goods.GoodsImages = data.Get("goods_images").String()
goods.GoodsBrief = data.Get("goods_brief").String()
goods.StandardBrand = data.Get("standard_brand").String()
goods.Mpl = int(data.Get("mpl").Int())
goods.MplStr = int(data.Get("mpl").Int())
goods.Status = int(data.Get("status").Int())
......
......@@ -176,7 +176,6 @@ func (qs *OptimumService) GetOptimumAttr(ctx *gin.Context) (results model.LyResp
*/
func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.LyResponse) {
redisConn := gredis.Conn("search_r")
//修复分页数据
if gconv.Int64(ctx.Request.FormValue("page"))*gconv.Int64(ctx.Request.FormValue("page_size")) > 10000 {
results.ErrorCode = 0
......@@ -264,9 +263,9 @@ func (qs *OptimumService) GetOptimumAttrInfo(ctx *gin.Context) (results model.Ly
}
//todo 标准品牌
brand_name_json, _ := redis.String(redisConn.Do("Hget", "standard_brand", v.BrandId))
v.BrandName = gjson.Get(brand_name_json, "brand_name").String()
v.BrandId = gconv.Int(gjson.Get(brand_name_json, "brand_id").String())
//fmt.Print(v.StandardBrand)
v.BrandName = gjson.Get(v.StandardBrand, "brand_name").String()
v.BrandId = gconv.Int(gjson.Get(v.StandardBrand, "brand_id").String())
v.StockStr = common.NumberToHtml(v.Stock)
v.MoqStr = common.NumberToHtml(v.Moq)
......
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