Przeglądaj źródła

Merge branch 'develop' into feature/app_dev

* develop:
  增加商品混合支付
abiao 4 lat temu
rodzic
commit
48435cb7da

+ 6 - 2
go/gopath/src/fohow.com/apps/helpers/benefit_helper.go

@@ -37,8 +37,12 @@ func NewSendInviterBenefit(wxUser *user_model.WxUser, orderId, source string) {
 		if benefitWxUser != nil {
 			//发放群主收益,(微信支付金额-运费)>0,按(微信支付金额-运费)*20%给上级代理返佣金
 			//val := []int64{productOrder.Pv - productOrder.Freight, productOrder.Pv}
-			//award_cash := tool.Min(val...)
-			award_cash := productOrder.Pv - productOrder.CouponPrice
+			//计算佣金的业绩=max(pv-max(扣提货券-运费,0),0)
+			award_cash := int64(0)
+			couponFee := productOrder.CouponPrice - productOrder.Freight
+			if couponFee > 0 {
+				award_cash = productOrder.Pv - couponFee
+			}
 			if award_cash <= 0 {
 				return
 			}