Commit 53346117 by mushishixian

切换获取分类到新版分类

parent 6616cd53
Showing with 12 additions and 10 deletions
......@@ -2,17 +2,18 @@ package service
import (
"encoding/json"
"github.com/gomodule/redigo/redis"
_ "github.com/iancoleman/orderedmap"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/pkg/common"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/logger"
_ "go_sku_server/pkg/mongo"
_ "gopkg.in/mgo.v2/bson"
"strings"
"github.com/gomodule/redigo/redis"
_ "github.com/iancoleman/orderedmap"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
_ "gopkg.in/mgo.v2/bson"
)
//获取图片信息
......@@ -79,20 +80,21 @@ func (ls *LyService) GetPoolSupplierName(supplierId int64) (supplierName string)
func (ls *LyService) GetCacheClass(classId int64) string {
redisCon := gredis.Conn("default_r")
defer redisCon.Close()
className, _ := redis.String(redisCon.Do("HGET", "class", classId))
classStr, _ := redis.String(redisCon.Do("HGET", "pool_class_info", classId))
className := gjson.Get(classStr, "class_name").String()
return className
}
type SpuAttr struct {
SpuId string `bson:"spu_id"`
SpuId string `bson:"spu_id"`
AttrsExtend []AttrsExtend `bson:"attrs_extend"`
Attrs string `bson:"attrs"`
Attrs string `bson:"attrs"`
}
type AttrsExtend struct {
AttrName string `bson:"attr_name" json:"attr_name"`
AttrName string `bson:"attr_name" json:"attr_name"`
AttrValue string `bson:"attr_value" json:"attr_value"`
AttrUnit string `bson:"attr_unit" json:"attr_unit,omitempty"`
AttrUnit string `bson:"attr_unit" json:"attr_unit,omitempty"`
}
//H获取供应链标准品牌
......
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