From 4914a5a2b8ec3b4670bf63e08b33e8e72fe6b90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 26 Aug 2020 13:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E6=89=A3=E6=B4=BB=E5=8A=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index d0c9be128..4012b94b3 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -1521,7 +1521,6 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) { for _, act := range page.Data { _, actStoreSkus, _ := dao.GetActStoreSkuVendorList(db, act.ID, nil, nil, nil, "", 0, pageSize) if len(actStoreSkus) == 0 { - fmt.Println("test1111111111111111111111111111111111", act.ID) continue } for _, actStoreSku2 := range actStoreSkus { @@ -1539,7 +1538,6 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) { } storeSkus, _ := dao.GetStoresSkusInfo(db, []int{actStoreSkuMap.StoreID}, []int{actStoreSkuMap.SkuID}) if len(storeSkus) == 0 { - fmt.Println("test222222222222222222222222222222222222", act.ID) continue } var ( @@ -1551,7 +1549,6 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) { minJxPrice int64 ) if storeSku.Stock == 0 { - fmt.Println("test33333333333333333333333333333333333333333", act.ID) continue } actualStockOut, err = dao.GetOrderStoreSkusCount(db, actStoreSkuMap.StoreID, actStoreSkuMap.SkuID, time.Now().Add(-time.Minute*10), time.Now()) @@ -1600,8 +1597,14 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) { //C >= 2N 涨价趋势,最高涨价到无折扣 if actualStockOut >= 2*shouldStockOut { actStoreSkuMap.TrendType = model.TrendTypeUp + if actStoreSkuMap.ActualActPrice == actStoreSkuMap.VendorPrice { + actStoreSkuMap.TrendType = model.TrendTypeNothing + } } else if actualStockOut < utils.Float64TwoInt64(math.Ceil(float64(shouldStockOut)/float64(2))) { //C <= N/2 降价趋势,最低降价到设置到最低折扣 actStoreSkuMap.TrendType = model.TrendTypeDown + if actStoreSkuMap.ActualActPrice == minJxPrice { + actStoreSkuMap.TrendType = model.TrendTypeNothing + } } else { actStoreSkuMap.TrendType = model.TrendTypeNothing }