每晚22点也恢复成原价把
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user