ソースを参照

增加商品混合支付

abiao 4 年 前
コミット
c23a6e8d01
共有1 個のファイルを変更した6 個の追加2 個の削除を含む
  1. 6 2
      go/gopath/src/fohow.com/apps/helpers/benefit_helper.go

+ 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
 			}