Commit e24ada75 by 杨树贤

Merge branch 'ysx-价格体系修改-20230815' into dev

# Conflicts:
#	service/service_ly_common.go
#	service/service_price.go
parents 6779c613 dcf5b8be
......@@ -77,6 +77,7 @@ type LySku struct {
DiscountRatio DiscountRatio `json:"discount_ratio"`
PriceRatioSort int `json:"price_ratio_sort"`
PriceRatio []PriceRatio `json:"price_ratio"`
Source int `json:"source"`
}
type DiscountRatio struct {
......@@ -85,8 +86,9 @@ type DiscountRatio struct {
}
type PriceRatio struct {
Ratio float64 `json:"ratio"`
RatioUsd float64 `json:"ratio_usd"`
Ratio float64 `json:"ratio"`
RatioUsd float64 `json:"ratio_usd"`
Purchases int64 `json:"purchases,omitempty"`
}
type PriceActivity struct {
......@@ -134,6 +136,10 @@ type StockInfo struct {
// 为什么不直接映射到结构,而要用gjson,因为redis存的数据结构不一定正常,可能类型不一致
func InitSkuData(sku string) (data LySku) {
source := gjson.Get(sku, "source").Int()
data.Source = int(source)
goodsSn := gjson.Get(sku, "goods_sn").String()
data.GoodsSn = goodsSn
......
......@@ -5,7 +5,6 @@ import (
"go_sku_server/pkg/gredis"
"go_sku_server/service/sorter"
"sort"
"strings"
"sync"
"github.com/gin-gonic/gin"
......@@ -65,16 +64,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
sku.Packing = gjson.Get(packing, "pack").String()
}
sku = ls.GetGoodsImages(sku, spu)
//pdf
pdf := gjson.Get(spu, "pdf").String()
if pdf != "" {
pdf = strings.Replace(pdf, "http://img.ichunt.com", "https://img.ichunt.com", 1)
//还要针对如果是自己的上传服务的pdf文件,还要补上类型用于预览
if (strings.Contains(pdf, "files.ichunt.net") || strings.Contains(pdf, "file.liexindev.net")) && !strings.Contains(pdf, "fileType=pdf") {
pdf += "?fileType=pdf"
}
sku.Pdf = pdf
}
sku = ls.GetPdf(sku, spu)
//获取商品名称
//1688就是mro的sku spuName和GoodsName不是一个东西,不能公用
......
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