From 6ed89093baa9c802a78ced8ba3e5be28e8a12cef 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, 19 Aug 2020 13:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=99=9A22=E7=82=B9=E4=B9=9F=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E6=88=90=E5=8E=9F=E4=BB=B7=E6=8A=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 86c26e4e9..68cf61571 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -1628,15 +1628,16 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) { if actStoreSkuMap.ActualActPrice <= minJxPrice { actStoreSkuMap.ActualActPrice = minJxPrice } - if _, err = dao.UpdateEntity(db, actStoreSkuMap, "ActualActPrice", "TrendType", "TrendPrice"); err != nil { - dao.Rollback(db) - } - //22:00 恢复库存为100 + //22:00 恢复库存为100,价格恢复原价 if time.Now().Hour() == 22 && time.Now().Minute() < 1 { storeSku.Stock = 100 if _, err = dao.UpdateEntity(db, storeSku, "Stock"); err != nil { dao.Rollback(db) } + actStoreSkuMap.ActualActPrice = actStoreSkuMap.VendorPrice + } + if _, err = dao.UpdateEntity(db, actStoreSkuMap, "ActualActPrice", "TrendType", "TrendPrice"); err != nil { + dao.Rollback(db) } } dao.Commit(db)