价格统计
This commit is contained in:
@@ -2247,9 +2247,9 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
}
|
||||
for _, v := range skuNameAndPlace {
|
||||
if skuNameMap[v.ID] != nil {
|
||||
midPrice, _ := dao.GetMidPriceByNameID(db, cityCode, v.ID, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||
if midPrice != 0 {
|
||||
v.Price = midPrice
|
||||
priceReferList, _, _ := dao.GetPriceReferSnapshot(db, []int{cityCode}, nil, v.ID, utils.Time2Date(time.Now().AddDate(0, 0, -1)), 0, 9999)
|
||||
if len(priceReferList) > 0 {
|
||||
v.Price = priceReferList[0].MidUnitPrice
|
||||
}
|
||||
v.Type = skuNameMap[v.ID].BrandID
|
||||
skuNameAndPlaceList = append(skuNameAndPlaceList, v)
|
||||
@@ -2813,7 +2813,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync,
|
||||
focusList, _ := dao.GetStoreSkuBindByNameID(db, store.ID, v.NameID, model.StoreSkuBindStatusNormal)
|
||||
//有关注过
|
||||
if len(focusList) > 0 {
|
||||
price = 0
|
||||
price = focusList[0].UnitPrice
|
||||
skuInfoMap[v.NameID] = append(skuInfoMap[v.NameID], &StoreSkuBindSkuInfo{
|
||||
SkuID: v.ID,
|
||||
IsSale: 1,
|
||||
@@ -2920,10 +2920,12 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuIDs []int, isAsync, isContin
|
||||
focusList, _ := dao.GetStoreSkuBindByNameID(db, store.ID, k, model.StoreSkuBindStatusNormal)
|
||||
//有关注过
|
||||
if len(focusList) > 0 {
|
||||
price = 0
|
||||
price = focusList[0].UnitPrice
|
||||
} else {
|
||||
midPrice, _ := dao.GetMidPriceByNameID(db, store.CityCode, k, utils.Time2Date(time.Now().AddDate(0, 0, -1)))
|
||||
price = midPrice
|
||||
priceReferList, _, _ := dao.GetPriceReferSnapshot(db, []int{store.CityCode}, nil, k, utils.Time2Date(time.Now().AddDate(0, 0, -1)), 0, 9999)
|
||||
if len(priceReferList) > 0 {
|
||||
price = priceReferList[0].MidUnitPrice
|
||||
}
|
||||
}
|
||||
skuBindInfo := &StoreSkuBindInfo{
|
||||
NameID: k,
|
||||
|
||||
Reference in New Issue
Block a user