畅销商品
This commit is contained in:
@@ -2235,8 +2235,8 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
}
|
||||
for _, v := range skuNameAndPlace {
|
||||
if skuNameMap[v.ID] != nil {
|
||||
midPrice, err := dao.GetMidPriceByNameID(db, cityCode, v.ID, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||
if err == nil {
|
||||
midPrice, _ := dao.GetMidPriceByNameID(db, cityCode, v.ID, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||
if midPrice != 0 {
|
||||
v.Price = midPrice
|
||||
}
|
||||
v.Type = skuNameMap[v.ID].BrandID
|
||||
|
||||
@@ -1352,7 +1352,7 @@ func GetMidPriceByNameID(db *DaoDB, cityCode, skuNameID int, snapDate time.Time)
|
||||
skuMap = make(map[int]int)
|
||||
)
|
||||
sql := `
|
||||
SELECT a.mid_price bind_price,a.sku_id,b.spec_quality
|
||||
SELECT a.mid_price bind_price,a.sku_id,b.spec_quality sku_spec_quality
|
||||
FROM price_refer_snapshot a
|
||||
JOIN sku b ON a.sku_id = b.id
|
||||
JOIN sku_name c ON c.id = b.name_id
|
||||
@@ -1369,10 +1369,12 @@ func GetMidPriceByNameID(db *DaoDB, cityCode, skuNameID int, snapDate time.Time)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
for _, v := range storeSkuExt {
|
||||
price = model.SpecialSpecQuality / int(utils.Float64TwoInt64(float64(v.SkuSpecQuality))) * v.BindPrice
|
||||
if skuMap[skuNameID] < price {
|
||||
skuMap[skuNameID] = price
|
||||
if len(storeSkuExt) > 0 {
|
||||
for _, v := range storeSkuExt {
|
||||
price = model.SpecialSpecQuality / int(utils.Float64TwoInt64(float64(v.SkuSpecQuality))) * v.BindPrice
|
||||
if skuMap[skuNameID] < price {
|
||||
skuMap[skuNameID] = price
|
||||
}
|
||||
}
|
||||
}
|
||||
return skuMap[skuNameID], err
|
||||
|
||||
Reference in New Issue
Block a user