测试折扣活动
This commit is contained in:
@@ -238,7 +238,11 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
if storeSkuInfo != nil {
|
if storeSkuInfo != nil {
|
||||||
jxPrice := storeSkuInfo.Price
|
jxPrice := storeSkuInfo.Price
|
||||||
actSkuMap.VendorPrice = int64(getVendorPriceFromStoreSkuBind(storeSkuInfo, vendorID))
|
actSkuMap.VendorPrice = int64(getVendorPriceFromStoreSkuBind(storeSkuInfo, vendorID))
|
||||||
v.OriginalPrice = int64(jxPrice)
|
if act.Type == model.ActSkuDiscount {
|
||||||
|
v.OriginalPrice = int64(storeSkuInfo.JxPrice)
|
||||||
|
} else {
|
||||||
|
v.OriginalPrice = int64(jxPrice)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var err2 error
|
var err2 error
|
||||||
if act.Type != model.ActSkuFake { // 非结算,要计算实际活动价格
|
if act.Type != model.ActSkuFake { // 非结算,要计算实际活动价格
|
||||||
@@ -1510,6 +1514,8 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) {
|
|||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
pageSize = 9999
|
pageSize = 9999
|
||||||
)
|
)
|
||||||
|
globals.SugarLogger.Debug("ChangeJxPriceByDiscountAct begin:")
|
||||||
|
fmt.Println("111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")
|
||||||
page, err := dao.QueryActs(db, 0, 0, pageSize, -1, "", model.VendorIDJX, []int{model.YES}, []int{model.ActSkuDiscount}, nil, 0, nil, 0, utils.ZeroTimeValue, utils.ZeroTimeValue, time.Now().AddDate(0, -3, 0), time.Now())
|
page, err := dao.QueryActs(db, 0, 0, pageSize, -1, "", model.VendorIDJX, []int{model.YES}, []int{model.ActSkuDiscount}, nil, 0, nil, 0, utils.ZeroTimeValue, utils.ZeroTimeValue, time.Now().AddDate(0, -3, 0), time.Now())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@@ -1517,6 +1523,7 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) {
|
|||||||
if len(page.Data) == 0 {
|
if len(page.Data) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
fmt.Println("122222222222222222222222222222222222222222222222222222222222222222222222222222", utils.Format4Output(page.Data, false))
|
||||||
for _, act := range page.Data {
|
for _, act := range page.Data {
|
||||||
_, actStoreSkus, _ := dao.GetActStoreSkuVendorList(db, act.ID, nil, nil, nil, "", 0, pageSize)
|
_, actStoreSkus, _ := dao.GetActStoreSkuVendorList(db, act.ID, nil, nil, nil, "", 0, pageSize)
|
||||||
if len(actStoreSkus) == 0 {
|
if len(actStoreSkus) == 0 {
|
||||||
@@ -1538,6 +1545,7 @@ func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) {
|
|||||||
if storeSku.Stock == 0 {
|
if storeSku.Stock == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
fmt.Println("33333333333333333333333333333333333333333333333333333333333333", utils.Format4Output(actStoreSku, false))
|
||||||
actualStockOut, err = dao.GetOrderStoreSkusCount(db, actStoreSku.StoreID, actStoreSku.SkuID, time.Now().Add(-time.Minute*10), time.Now())
|
actualStockOut, err = dao.GetOrderStoreSkusCount(db, actStoreSku.StoreID, actStoreSku.SkuID, time.Now().Add(-time.Minute*10), time.Now())
|
||||||
dao.Begin(db)
|
dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user