Commit 78d33064 by 杨树贤

打上标签

parent 70482c93
Showing with 16 additions and 8 deletions
package service
import (
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/vars"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
)
//标签相关服务,包括goods_label
......@@ -14,10 +15,10 @@ import (
type TagsService struct {
}
//当天发货标签
// 当天发货标签
const TagZiyingSku = 4
//获取Spu的属性
// 获取Spu的属性
func (ts *TagsService) GetTags(skuId string, selfSupplierType int64) (goodsTags model.GoodsTag) {
redisCon := gredis.Conn("default_r")
defer redisCon.Close()
......@@ -52,13 +53,15 @@ func (ts *TagsService) GetTags(skuId string, selfSupplierType int64) (goodsTags
goodsTags.GoodsLabelName = vars.GoodsTags[TagZiyingSku]
}
}
tagNames = append(tagNames, "当天发货")
goodsTags.GoodsTagNames = tagNames
goodsTags.GoodsTag = tags
return goodsTags
}
//获取联营tags
// 获取联营tags
func (ts *TagsService) GetLyTags(sku model.LySku) (goodsTags model.GoodsTag) {
skuId := sku.GoodsId
redisCon := gredis.Conn("default_r")
......@@ -83,13 +86,18 @@ func (ts *TagsService) GetLyTags(sku model.LySku) (goodsTags model.GoodsTag) {
for _, cname := range customerTagArr {
//如果是爱智的话,去掉可议价标签
if sku.OrgId ==3 && cname == "可议价" {
if sku.OrgId == 3 && cname == "可议价" {
continue
}
tagNames = append(tagNames, cname)
}
}
}
if sku.Source == 12 {
tagNames = append(tagNames, "当天发货")
}
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