...
|
...
|
@@ -61,14 +61,31 @@ func QuartersBonusStatics(orders []*domain.OrderBase, action int) (bonus []proto |
|
|
bonus = make([]protocol.Bonus, 4)
|
|
|
for i := range orders {
|
|
|
o := orders[i]
|
|
|
quarter := (o.CreateTime.Month() - 1) / 3
|
|
|
quarter := quarter(o.CreateTime)
|
|
|
bonus[quarter].Receivable = utils.Decimal(bonus[quarter].Receivable + o.PlanPartnerBonus)
|
|
|
bonus[quarter].Received = utils.Decimal(bonus[quarter].Received + o.OrderBonusReceive())
|
|
|
bonus[quarter].Outstanding = utils.Decimal(bonus[quarter].Outstanding + o.OrderBonusWait())
|
|
|
bonus[quarter].Expend = utils.Decimal(bonus[quarter].Expend + o.OrderBonusOutstanding())
|
|
|
//bonus[quarter].Expend = utils.Decimal(bonus[quarter].Expend + o.OrderBonusOutstanding())
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// 季度
|
|
|
func quarter(t time.Time) int {
|
|
|
q := t.Month()
|
|
|
switch q {
|
|
|
case 4, 5, 6:
|
|
|
return 0
|
|
|
case 7, 8, 9:
|
|
|
return 1
|
|
|
case 10, 11, 12:
|
|
|
return 2
|
|
|
case 1, 2, 3:
|
|
|
return 3
|
|
|
}
|
|
|
return 0
|
|
|
}
|
|
|
|
|
|
// 分红订单
|
|
|
func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersRequest) (rsp *protocol.DividendOrdersResponse, err error) {
|
|
|
var (
|
...
|
...
|
|