Commit f10efb25 by 杨树贤

Merge branch 'master' into dev

parents 404a6d24 b317e448
......@@ -86,6 +86,7 @@ type LySku struct {
OriginCurrencySymbol string `json:"origin_currency_symbol,omitempty"`
CustomizeRateRMB float64
CustomizeRateUs float64
SpuEccn string `json:"spu_eccn"`
}
type DiscountRatio struct {
......@@ -148,6 +149,7 @@ type SpuExtra struct {
Name string `bson:"name" json:"name"`
Thumbnail string `bson:"thumbnail" json:"thumbnail"`
} `bson:"image_list" json:"image_list"`
SpuDetail string `bson:"spu_detail" json:"spu_detail"`
SpuId string `bson:"spu_id" json:"spu_id"`
EnPdfUrl string `bson:"en_pdf_url" json:"en_pdf_url"`
......
......@@ -289,5 +289,31 @@ func (ls *LyService) GetSpuExtra(spuId string) (spuExtra model.SpuExtra) {
if err != nil && err != mgo.ErrNotFound {
logger.Select("sku_query").Error(err.Error())
}
//兼容老版本数据
if len(spuExtra.ImageList) == 0 {
type OldSpuExtra struct {
OldImageList map[string]struct {
Name string `bson:"name"`
Thumbnail string `bson:"thumbnail"`
} `bson:"image_list" json:"old_image_list"`
}
var oldSpuExtra OldSpuExtra
err = mongodb.DB("ichunt").C("spu_extra").Find(bson.M{"spu_id": spuId}).One(&oldSpuExtra)
for _, image := range oldSpuExtra.OldImageList {
spuExtra.ImageList = append(spuExtra.ImageList,struct {
Name string `bson:"name" json:"name"`
Thumbnail string `bson:"thumbnail" json:"thumbnail"`
}{
Name: image.Name,
Thumbnail: image.Thumbnail,
})
}
}
return spuExtra
}
......@@ -262,6 +262,7 @@ func (ls *LyService) CombineSup(sku model.LySku, spuStr string) model.LySku {
sku.SpuDetail = gjson.Get(spuStr, "spu_detail").String()
sku.Status = int(gjson.Get(spuStr, "status").Int())
sku.Encap = gjson.Get(spuStr, "encap").String()
sku.SpuEccn = gjson.Get(spuStr, "eccn").String()
return sku
}
......
......@@ -17,7 +17,8 @@ type ZiyingService struct {
}
/*
自营数据详情
自营数据详情
查询商品详情(自营或者联营)
@doc http://192.168.2.232:3000/project/128/interface/api/649
......@@ -169,12 +170,7 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
A.Set("saler_atio", "") //
}
if len(attrs) == 0 {
A.Set("attrs", "") //属性值
} else {
A.Set("attrs", attrs) //
}
A.Set("attrs", attrs) //
A.Set("cost", gjson.Get(info, "cost").String()) //
A.Set("new_cost", gjson.Get(info, "new_cost").String()) //
A.Set("supplier_stock", gjson.Get(info, "supplier_stock").Int()) //
......
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