作者 yangfu

分红统计修改

... ... @@ -35,8 +35,8 @@ func Login(header *protocol.RequestHeader, request *protocol.LoginRequest) (rsp
//子账号
err = protocol.NewErrWithMessage(502, err) //账号不存在
return
}
partnerInfo.Password = partnerSubAccount.Password
} else {
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"account": request.Phone}); err != nil {
//子账号
... ...
... ... @@ -51,13 +51,8 @@ func AllBonusStatics(orders []*domain.Order, action int) (bonus protocol.Bonus)
bonus = protocol.Bonus{}
for i := range orders {
o := orders[i]
//if action == protocol.BonusTotal {
bonus.Received += o.OrderBonusReceive()
bonus.Outstanding += o.OrderBonusWait()
//}
//if action == protocol.BonusOutstanding {
// bonus.Outstanding += o.OrderBonusOutstanding()
//}
bonus.Received = utils.Decimal(bonus.Received + o.OrderBonusReceive())
bonus.Outstanding = utils.Decimal(bonus.Outstanding + o.OrderBonusWait())
}
return
}
... ... @@ -67,17 +62,10 @@ func QuartersBonusStatics(orders []*domain.Order, action int) (bonus []protocol.
bonus = make([]protocol.Bonus, 4)
for i := range orders {
o := orders[i]
quarter := o.CreateAt.Month() / 3
bonus[quarter].Received += o.OrderBonusReceive()
bonus[quarter].Outstanding += o.OrderBonusWait()
bonus[quarter].Expend += o.OrderBonusOutstanding()
//if action == protocol.BonusTotal {
//bonus[quarter].Received += o.OrderBonusReceive()
//bonus[quarter].Outstanding += o.OrderBonusWait()
//}
//if action == protocol.BonusOutstanding {
//bonus[quarter].Expend += o.OrderBonusOutstanding()
//}
quarter := (o.CreateAt.Month() - 1) / 3
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())
}
return
}
... ...