Commit fc1a765a by mushishixian

Merge branch 'ysx-商品服务-20201013'

parents c182125f b910bfb7
...@@ -24,6 +24,7 @@ type LySku struct { ...@@ -24,6 +24,7 @@ type LySku struct {
LadderPriceResult interface{} `json:"ladder_price"` LadderPriceResult interface{} `json:"ladder_price"`
GoodsImages string `json:"goods_images"` GoodsImages string `json:"goods_images"`
Canal string `json:"canal"` Canal string `json:"canal"`
IsExpire int `json:"is_expire,omitempty"`
Packing string `json:"packing"` Packing string `json:"packing"`
GoodsId string `json:"goods_id"` GoodsId string `json:"goods_id"`
GoodsName string `json:"goods_name"` GoodsName string `json:"goods_name"`
...@@ -36,7 +37,7 @@ type LySku struct { ...@@ -36,7 +37,7 @@ type LySku struct {
BrandId int64 `json:"brand_id"` BrandId int64 `json:"brand_id"`
//系数相关 //系数相关
Coefficient interface{} `json:"coefficient,omitempty"` Coefficient interface{} `json:"coefficient,omitempty"`
Original interface{} `json:"original_price"` Original interface{} `json:"original_price,omitempty"`
SuppExtendFee interface{} `json:"supp_extend_fee"` SuppExtendFee interface{} `json:"supp_extend_fee"`
IsBuy int `json:"is_buy"` IsBuy int `json:"is_buy"`
//spu信息 //spu信息
...@@ -105,6 +106,9 @@ func InitSkuData(sku string) (data LySku) { ...@@ -105,6 +106,9 @@ func InitSkuData(sku string) (data LySku) {
stock := gjson.Get(sku, "stock").Int() stock := gjson.Get(sku, "stock").Int()
data.Stock = stock data.Stock = stock
isExpire := gjson.Get(sku, "is_expire").Int()
data.IsExpire = int(isExpire)
hkDeliveryTime := gjson.Get(sku, "hk_delivery_time").String() hkDeliveryTime := gjson.Get(sku, "hk_delivery_time").String()
data.HkDeliveryTime = hkDeliveryTime data.HkDeliveryTime = hkDeliveryTime
......
...@@ -122,7 +122,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan ...@@ -122,7 +122,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
//活动标识 //活动标识
hasActivity := false hasActivity := false
//判断是否有新客价权利 //判断是否有新客价权利
if isNewCustomer == "true" { if isNewCustomer == "true" || isNewCustomer == "1" {
//获取新客价 //获取新客价
sku = ls.GetActivityPrice(sku, "_NewCustomer", power) sku = ls.GetActivityPrice(sku, "_NewCustomer", power)
if sku.AcType > 0 { if sku.AcType > 0 {
...@@ -138,7 +138,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan ...@@ -138,7 +138,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
} }
//获取会员价 //获取会员价
if !hasActivity && power.Member == "true" { if !hasActivity && (power.Member == "true" || power.Member == "1") {
sku = ls.GetActivityPrice(sku, "_Member", power) sku = ls.GetActivityPrice(sku, "_Member", power)
if sku.AcType > 0 { if sku.AcType > 0 {
hasActivity = true hasActivity = true
......
...@@ -193,6 +193,7 @@ func (ls *LyService) GetExtendFee(supplierId int64, canal string) interface{} { ...@@ -193,6 +193,7 @@ func (ls *LyService) GetExtendFee(supplierId int64, canal string) interface{} {
//获取系数 //获取系数
func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku { func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku {
if len(sku.LadderPrice) == 0 { if len(sku.LadderPrice) == 0 {
sku.Original = nil
return sku return sku
} }
flag := 0 flag := 0
......
...@@ -215,8 +215,10 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe ...@@ -215,8 +215,10 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
allowNotLogin = 2 allowNotLogin = 2
} }
sku.ActivityInfo = map[string]interface{}{ sku.ActivityInfo = map[string]interface{}{
"activity_id": gjson.Get(activityInfo, "activity_ad").String(), "activity_ad": gjson.Get(activityInfo, "activity_ad").String(),
"sign_name": gjson.Get(activityInfo, "sign_name").String(), "sign_name": gjson.Get(activityInfo, "sign_name").String(),
"id": gjson.Get(activityInfo, "id").String(),
"activity_name": gjson.Get(activityInfo, "activity_name").String(),
"allow_not_login": allowNotLogin, "allow_not_login": allowNotLogin,
} }
sku.AcType = 8 sku.AcType = 8
......
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