|
@@ -2,6 +2,7 @@ package domain |
|
@@ -2,6 +2,7 @@ package domain |
|
2
|
|
2
|
|
|
3
|
import (
|
3
|
import (
|
|
4
|
"errors"
|
4
|
"errors"
|
|
|
|
5
|
+ "fmt"
|
|
5
|
|
6
|
|
|
6
|
"github.com/shopspring/decimal"
|
7
|
"github.com/shopspring/decimal"
|
|
7
|
)
|
8
|
)
|
|
@@ -112,6 +113,9 @@ func (good OrderGood) GetCurrentPartnerBonus() float64 { |
|
@@ -112,6 +113,9 @@ func (good OrderGood) GetCurrentPartnerBonus() float64 { |
|
112
|
|
113
|
|
|
113
|
//GetCurrentAmount 获取当前的商品合伙人分红
|
114
|
//GetCurrentAmount 获取当前的商品合伙人分红
|
|
114
|
func (good *OrderGood) ModifyOrderGoodNumber(number int, orderType int) error {
|
115
|
func (good *OrderGood) ModifyOrderGoodNumber(number int, orderType int) error {
|
|
|
|
116
|
+ if good.PlanGoodNumber < number {
|
|
|
|
117
|
+ return fmt.Errorf("修改数量不能大于初始值:%d", good.PlanGoodNumber)
|
|
|
|
118
|
+ }
|
|
115
|
err := good.CurrentBonusStatus.ModifyOrderGoodNumber(good, number, orderType)
|
119
|
err := good.CurrentBonusStatus.ModifyOrderGoodNumber(good, number, orderType)
|
|
116
|
return err
|
120
|
return err
|
|
117
|
}
|
121
|
}
|