master
howell 4 years ago
parent 2811632f79
commit 52d6803b0c

@ -51,8 +51,8 @@ func (o IncomeType) GetProfit() decimal.Decimal {
return profitMap[o]
}
func CreateProfit(id uint, t1 IncomeType, base decimal.Decimal, orderID uint) Profit {
return Profit{
func CreateProfit(id uint, t1 IncomeType, base decimal.Decimal, orderID uint) *Profit {
return &Profit{
OrderID: orderID,
Base: base,
Type: t1,

@ -1,9 +1,10 @@
package shop
import (
"github.com/jinzhu/gorm"
"recook/internal/model/order"
"recook/internal/model/user"
"github.com/jinzhu/gorm"
)
func OrderProfit(od order.Information, tx *gorm.DB) error {
@ -15,9 +16,6 @@ func OrderProfit(od order.Information, tx *gorm.DB) error {
condition := od.SharerID == od.UserID
base := od.ActualTotalAmount.Sub(od.Cost).Sub(od.ExpressTotalFee)
if u1.Level == 0 {
return nil
}
switch u1.Level {
case 0:

Loading…
Cancel
Save