Commit 4291b2f8 by mushishixian

fix

parent 545f3731
Showing with 11 additions and 11 deletions
......@@ -22,6 +22,9 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
redisCon := gredis.Conn("default_r")
goodsTagsStr, _ := redis.String(redisCon.Do("HGET", "goods_tag", skuId))
goodsLabel := ""
//goods_tag
var tags []int
var tagNames []string
if goodsTagsStr != "" {
//goods_label
goodsLabelType := int(gjson.Get(goodsTagsStr, "goods_label").Int())
......@@ -30,23 +33,20 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
goodsTags.GoodsLabelName = goodsLabel
goodsTags.GoodsLabel = goodsLabelType
//goods_tag
var tags []int
var tagNames []string
for _, tagResult := range gjson.Get(goodsTagsStr, "tags").Array() {
tagName := vars.GoodsTags[int(tagResult.Int())]
tagNames = append(tagNames, tagName)
tags = append(tags, int(tagResult.Int()))
}
//如果是自营商品Id,就写死当天发货标签
if len(skuId) > 10 {
if !php2go.InArray(TagZiyingSku, tags) {
tags = append(tags, TagZiyingSku)
tagNames = append(tagNames, vars.GoodsTags[TagZiyingSku])
}
}
//如果是自营商品Id,就写死当天发货标签
if len(skuId) < 10 {
if !php2go.InArray(TagZiyingSku, tags) {
tags = append(tags, TagZiyingSku)
tagNames = append(tagNames, vars.GoodsTags[TagZiyingSku])
}
goodsTags.GoodsTagNames = tagNames
goodsTags.GoodsTag = tags
}
goodsTags.GoodsTagNames = tagNames
goodsTags.GoodsTag = tags
return goodsTags
}
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