Commit 545f3731 by mushishixian

自营写死标签

parent 5138157b
Showing with 11 additions and 0 deletions
...@@ -2,6 +2,7 @@ package service ...@@ -2,6 +2,7 @@ package service
import ( import (
"github.com/gomodule/redigo/redis" "github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"go_sku_server/model" "go_sku_server/model"
"go_sku_server/pkg/gredis" "go_sku_server/pkg/gredis"
...@@ -13,6 +14,9 @@ import ( ...@@ -13,6 +14,9 @@ import (
type TagsService struct { type TagsService struct {
} }
//当天发货标签
const TagZiyingSku = 4
//获取Spu的属性 //获取Spu的属性
func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) { func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
redisCon := gredis.Conn("default_r") redisCon := gredis.Conn("default_r")
...@@ -34,6 +38,13 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) { ...@@ -34,6 +38,13 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
tagNames = append(tagNames, tagName) tagNames = append(tagNames, tagName)
tags = append(tags, int(tagResult.Int())) 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])
}
}
goodsTags.GoodsTagNames = tagNames goodsTags.GoodsTagNames = tagNames
goodsTags.GoodsTag = tags goodsTags.GoodsTag = tags
} }
......
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