|
@@ -61,14 +61,31 @@ func QuartersBonusStatics(orders []*domain.OrderBase, action int) (bonus []proto |
|
@@ -61,14 +61,31 @@ func QuartersBonusStatics(orders []*domain.OrderBase, action int) (bonus []proto |
61
|
bonus = make([]protocol.Bonus, 4)
|
61
|
bonus = make([]protocol.Bonus, 4)
|
62
|
for i := range orders {
|
62
|
for i := range orders {
|
63
|
o := orders[i]
|
63
|
o := orders[i]
|
64
|
- quarter := (o.CreateTime.Month() - 1) / 3
|
64
|
+ quarter := quarter(o.CreateTime)
|
|
|
65
|
+ bonus[quarter].Receivable = utils.Decimal(bonus[quarter].Receivable + o.PlanPartnerBonus)
|
65
|
bonus[quarter].Received = utils.Decimal(bonus[quarter].Received + o.OrderBonusReceive())
|
66
|
bonus[quarter].Received = utils.Decimal(bonus[quarter].Received + o.OrderBonusReceive())
|
66
|
bonus[quarter].Outstanding = utils.Decimal(bonus[quarter].Outstanding + o.OrderBonusWait())
|
67
|
bonus[quarter].Outstanding = utils.Decimal(bonus[quarter].Outstanding + o.OrderBonusWait())
|
67
|
- bonus[quarter].Expend = utils.Decimal(bonus[quarter].Expend + o.OrderBonusOutstanding())
|
68
|
+ //bonus[quarter].Expend = utils.Decimal(bonus[quarter].Expend + o.OrderBonusOutstanding())
|
68
|
}
|
69
|
}
|
69
|
return
|
70
|
return
|
70
|
}
|
71
|
}
|
71
|
|
72
|
|
|
|
73
|
+// 季度
|
|
|
74
|
+func quarter(t time.Time) int {
|
|
|
75
|
+ q := t.Month()
|
|
|
76
|
+ switch q {
|
|
|
77
|
+ case 4, 5, 6:
|
|
|
78
|
+ return 0
|
|
|
79
|
+ case 7, 8, 9:
|
|
|
80
|
+ return 1
|
|
|
81
|
+ case 10, 11, 12:
|
|
|
82
|
+ return 2
|
|
|
83
|
+ case 1, 2, 3:
|
|
|
84
|
+ return 3
|
|
|
85
|
+ }
|
|
|
86
|
+ return 0
|
|
|
87
|
+}
|
|
|
88
|
+
|
72
|
// 分红订单
|
89
|
// 分红订单
|
73
|
func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersRequest) (rsp *protocol.DividendOrdersResponse, err error) {
|
90
|
func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersRequest) (rsp *protocol.DividendOrdersResponse, err error) {
|
74
|
var (
|
91
|
var (
|