作者 唐旭辉

修改

@@ -213,7 +213,11 @@ func (good *OrderGood) Compute() error { @@ -213,7 +213,11 @@ func (good *OrderGood) Compute() error {
213 //计算预计货品总值 213 //计算预计货品总值
214 //计算预计合伙人分红 214 //计算预计合伙人分红
215 price := decimal.NewFromFloat(good.Price) 215 price := decimal.NewFromFloat(good.Price)
216 - planamount := price.Mul(decimal.NewFromInt(int64(good.PlanGoodNumber))) //price*planGoodNumber 216 + planGoodNumber := good.PlanGoodNumber
  217 + if good.PlanGoodNumber < 0 {
  218 + planGoodNumber = 0
  219 + }
  220 + planamount := price.Mul(decimal.NewFromInt(int64(planGoodNumber))) //price*planGoodNumber
217 var partnerBonusPercent float64 221 var partnerBonusPercent float64
218 if good.PartnerBonusPercent < 0 { 222 if good.PartnerBonusPercent < 0 {
219 partnerBonusPercent = 0 223 partnerBonusPercent = 0