Commit bf33586b by huangchengyi
parents c755e533 9a5e6eb1
...@@ -201,8 +201,6 @@ func (ls *LyService) getSpuList(skuArr map[string]string) (spuList map[string]st ...@@ -201,8 +201,6 @@ func (ls *LyService) getSpuList(skuArr map[string]string) (spuList map[string]st
spuId := gjson.Get(skuStr, "spu_id").String() spuId := gjson.Get(skuStr, "spu_id").String()
spuIds = append(spuIds, spuId) spuIds = append(spuIds, spuId)
} }
redisConn := gredis.Conn("default_r")
defer redisConn.Close()
//批量获取spu详情 //批量获取spu详情
spuList = gredis.Hmget("default_r", "spu", spuIds) spuList = gredis.Hmget("default_r", "spu", spuIds)
return return
......
...@@ -279,6 +279,7 @@ func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku { ...@@ -279,6 +279,7 @@ func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku {
} }
if !hasCoefficient && !hasDefault { if !hasCoefficient && !hasDefault {
logger.Error("%s", "系数获取异常,供应商:"+common.ToString(sku.SupplierId)) logger.Error("%s", "系数获取异常,供应商:"+common.ToString(sku.SupplierId))
sku.Content = "系数获取异常,供应商:"+common.ToString(sku.SupplierId)
return sku return sku
} }
...@@ -339,13 +340,13 @@ func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku { ...@@ -339,13 +340,13 @@ func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku {
} }
} }
} }
if len(data) > 0 {
sku.LadderPrice = data
}
//输出税费到前端 //输出税费到前端
coefficient.Tax = tax coefficient.Tax = tax
sku.Coefficient = coefficient sku.Coefficient = coefficient
} }
if len(data) > 0 {
sku.LadderPrice = data
}
return sku return sku
} }
...@@ -393,19 +394,14 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) { ...@@ -393,19 +394,14 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) {
//合并spu的信息 //合并spu的信息
func (ls *LyService) CombineSup(sku model.LySku, spuStr string) model.LySku { func (ls *LyService) CombineSup(sku model.LySku, spuStr string) model.LySku {
var spu model.Spu sku.UpdateTime = gjson.Get(spuStr,"update_time").Int()
err := json.Unmarshal([]byte(spuStr), &spu) sku.ClassID1 = int(gjson.Get(spuStr,"class_id1").Int())
if err != nil { sku.ClassID2 = int(gjson.Get(spuStr,"class_id2").Int())
return sku sku.SpuName = gjson.Get(spuStr,"spu_name").String()
} sku.SpuBrief =gjson.Get(spuStr,"spu_brief").String()
sku.UpdateTime = spu.UpdateTime sku.SpuDetail = gjson.Get(spuStr,"spu_detail").String()
sku.ClassID1 = spu.ClassID1 sku.Status = int(gjson.Get(spuStr,"status").Int())
sku.ClassID2 = spu.ClassID2 sku.Encap = gjson.Get(spuStr,"encap").String()
sku.SpuName = spu.SpuName
sku.SpuBrief = spu.SpuBrief
sku.SpuDetail = spu.SpuDetail
sku.Status = spu.Status
sku.Encap = spu.Encap
return sku return sku
} }
......
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