From 702e49d959402cfdecb9af871df6712e47ec7838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 10 Aug 2020 14:49:43 +0800 Subject: [PATCH] actrule --- business/jxstore/act/act.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index 016b0e7a5..b1975d5eb 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -424,6 +424,8 @@ func getActRule(vendorID, actType int) (actRule *tActRuleInfo, err error) { func checkDiscountValidation(vendorIDs []int, actType int, pricePercentage float64) (err error) { pricePercentageMin := int(math.Floor(pricePercentage)) pricePercentageMax := int(math.Ceil(pricePercentage)) + fmt.Println(pricePercentageMin, pricePercentageMax, pricePercentage) + errList := errlist.New() for _, vendorID := range vendorIDs { actRule, err2 := getActRule(vendorID, actType) @@ -431,7 +433,6 @@ func checkDiscountValidation(vendorIDs []int, actType int, pricePercentage float if pricePercentageMin < actRule.MinDiscount { errList.AddErr(fmt.Errorf("%s%s活动折扣必须大于:%d", model.VendorChineseNames[vendorID], model.ActTypeName[actType], actRule.MinDiscount)) } else if pricePercentageMax > actRule.MaxDiscount { - fmt.Println(pricePercentageMax, actRule.MaxDiscount) errList.AddErr(fmt.Errorf("%s%s活动折扣必须小于:%d", model.VendorChineseNames[vendorID], model.ActTypeName[actType], actRule.MaxDiscount)) } } else {