...
|
...
|
@@ -6,7 +6,6 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
// 订单统计
|
...
|
...
|
@@ -25,7 +24,7 @@ func StatisticsV2(header *protocol.RequestHeader, request *protocol.OrderStatist |
|
|
|
|
|
//事业分红/业务分红
|
|
|
var total float64
|
|
|
if bonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: request.PartnerId, OrderTypes: domain.UserOrderTypes(domain.Career)}); e == nil {
|
|
|
if bonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: request.PartnerId, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
|
|
|
total += bonus.Bonus
|
|
|
}
|
|
|
calcOrderStatic := func(catId int, total float64) protocol.OrderStatic {
|
...
|
...
|
@@ -37,12 +36,13 @@ func StatisticsV2(header *protocol.RequestHeader, request *protocol.OrderStatist |
|
|
PartnerCategoryId: catId,
|
|
|
})
|
|
|
cumulativeQuantity, cumulativeMoney, _ := OrderDao.OrderStatics(&domain.OrderStaticQuery{
|
|
|
EndTime: time.Now().Unix() * 1000,
|
|
|
//EndTime: time.Now().Unix() * 1000,
|
|
|
EndTime: utils.GetDayEnd().Unix() * 1000,
|
|
|
OrderTypes: domain.UserOrderTypes(domain.Career),
|
|
|
PartnerId: request.PartnerId,
|
|
|
PartnerCategoryId: catId,
|
|
|
})
|
|
|
bonus, _ := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: request.PartnerId, OrderTypes: domain.UserOrderTypes(domain.Career), PartnerCategoryId: catId})
|
|
|
bonus, _ := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: request.PartnerId, OrderTypes: domain.UserOrderTypes(domain.Career), PartnerCategoryId: catId, EndTime: utils.GetDayEnd().Unix() * 1000})
|
|
|
var percent float64 = 0
|
|
|
if bonus.Bonus != 0 {
|
|
|
percent = utils.DecimalToNumber(bonus.Bonus * 100 / total)
|
...
|
...
|
|