作者 陈志颖

合并分支 'dev' 到 'test'

fix:分红统计增加时间限制



查看合并请求 !58
... ... @@ -170,7 +170,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.OrderStatistic
//事业分红/业务分红
var careerBonus, businessBonus, total float64 //,developBonus,appBonus
if bonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: header.UserId, OrderTypes: domain.UserOrderTypes(domain.Career)}); e == nil {
if bonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: header.UserId, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
careerBonus = bonus.Bonus
total += careerBonus
}
... ...
... ... @@ -66,12 +66,12 @@ func getDetail(userId int64, transactionContext *transaction.TransactionContext)
}
}
p.CooperateTime = partner.CooperateTime.Unix() * 1000
if bonus, e := OrderBaseDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, OrderTypes: domain.UserOrderTypes(domain.Career)}); e == nil {
if bonus, e := OrderBaseDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
p.CareerOrdersCount = int(bonus.Total)
p.CareerOrdersMoney = utils.Decimal(bonus.TotalOrderAmount)
p.CareerDividend = utils.Decimal(bonus.Bonus)
}
if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, IsDisable: 1}); e == nil {
if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, IsDisable: 1, EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
p.BusinessOrdersCount = int(businessBonus.Total)
p.BusinessOrdersMoney = utils.Decimal(businessBonus.TotalOrderAmount)
p.BusinessDividend = utils.Decimal(businessBonus.Bonus)
... ...
... ... @@ -238,12 +238,12 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) {
return response, nil
}
totalBonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), OrderTypes: domain.UserOrderTypes(domain.Career)})
totalBonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000})
if e != nil {
return response, e
}
if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), IsDisable: 1}); e == nil {
if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), IsDisable: 1, EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
totalBonus.Bonus += businessBonus.Bonus
}
... ... @@ -290,7 +290,7 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) {
continue
}
bonus, _ := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: partner.Id, OrderTypes: domain.UserOrderTypes(domain.Career)})
bonus, _ := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: partner.Id, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000})
if v, ok := mapPartnerBussinessBonus[partner.Id]; ok {
bonus.Bonus += v.Bonus
}
... ...