diff --git a/business/partner/purchase/tao_vegetable/act.go b/business/partner/purchase/tao_vegetable/act.go index c5da7b861..93f183abb 100644 --- a/business/partner/purchase/tao_vegetable/act.go +++ b/business/partner/purchase/tao_vegetable/act.go @@ -62,10 +62,10 @@ func storeSku2ActData(act *model.Act2, actStoreSku []*model.ActStoreSku2, handle var ( limitCount = int64(1) userLimitCount = int64(1) - //fixPriceMoney = int64(0) - discountRate = int64(0) - //decreaseMoney = int64(0) - limitDaily = int64(1) + fixPriceMoney = int64(0) + discountRate = int64(0) + decreaseMoney = int64(0) + limitDaily = int64(1) ) if act.LimitCount > 0 { limitCount = int64(act.LimitCount) @@ -83,21 +83,11 @@ func storeSku2ActData(act *model.Act2, actStoreSku []*model.ActStoreSku2, handle stock = int64(v.Stock) } - sType := *actType2Txd(v.Type) - switch sType { - case tao_vegetable.DiscountTypeDeductMoney: - //decreaseMoney = v.VendorPrice - v.ActualActPrice - case tao_vegetable.DiscountTypeOnePrice: - //fixPriceMoney = v.ActualActPrice - case tao_vegetable.DiscountTypeDiscounts: - discountRate = int64(v.PricePercentage * 10) - } - actData = &domain.AlibabaRetailMarketingItemdiscountActivitySkuAddItemDiscountActivityElementOperateRequest{ SkuElements: &[]domain.AlibabaRetailMarketingItemdiscountActivitySkuAddSkuActivityElementDto{{ SkuCode: utils.String2Pointer(utils.Int2Str(v.SkuID)), //FixPriceMoney: &fixPriceMoney, - DiscountRate: &discountRate, + //DiscountRate: &discountRate, //DecreaseMoney: &decreaseMoney, Limit: &domain.AlibabaRetailMarketingItemdiscountActivitySkuAddLimitDto{ TotalLimitCnt: &stock, @@ -111,7 +101,25 @@ func storeSku2ActData(act *model.Act2, actStoreSku []*model.ActStoreSku2, handle CreatorName: &v.LastOperator, OutActId: utils.String2Pointer(utils.Int2Str(v.ActID)), } - //actData = append(actData, temp) + + sType := *actType2Txd(v.Type) + switch sType { + case tao_vegetable.DiscountTypeDeductMoney: + decreaseMoney = v.VendorPrice - v.ActualActPrice + actData.SkuElements = &[]domain.AlibabaRetailMarketingItemdiscountActivitySkuAddSkuActivityElementDto{{ + DecreaseMoney: &decreaseMoney, + }} + case tao_vegetable.DiscountTypeOnePrice: + fixPriceMoney = v.ActualActPrice + actData.SkuElements = &[]domain.AlibabaRetailMarketingItemdiscountActivitySkuAddSkuActivityElementDto{{ + FixPriceMoney: &fixPriceMoney, + }} + case tao_vegetable.DiscountTypeDiscounts: + discountRate = int64(v.PricePercentage * 10) + actData.SkuElements = &[]domain.AlibabaRetailMarketingItemdiscountActivitySkuAddSkuActivityElementDto{{ + DiscountRate: &discountRate, + }} + } } } return actData