作者 陈志颖

合并分支 'dev' 到 'test'

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



查看合并请求 !58
@@ -170,7 +170,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.OrderStatistic @@ -170,7 +170,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.OrderStatistic
170 170
171 //事业分红/业务分红 171 //事业分红/业务分红
172 var careerBonus, businessBonus, total float64 //,developBonus,appBonus 172 var careerBonus, businessBonus, total float64 //,developBonus,appBonus
173 - if bonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: header.UserId, OrderTypes: domain.UserOrderTypes(domain.Career)}); e == nil { 173 + if bonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: header.UserId, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
174 careerBonus = bonus.Bonus 174 careerBonus = bonus.Bonus
175 total += careerBonus 175 total += careerBonus
176 } 176 }
@@ -66,12 +66,12 @@ func getDetail(userId int64, transactionContext *transaction.TransactionContext) @@ -66,12 +66,12 @@ func getDetail(userId int64, transactionContext *transaction.TransactionContext)
66 } 66 }
67 } 67 }
68 p.CooperateTime = partner.CooperateTime.Unix() * 1000 68 p.CooperateTime = partner.CooperateTime.Unix() * 1000
69 - if bonus, e := OrderBaseDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, OrderTypes: domain.UserOrderTypes(domain.Career)}); e == nil { 69 + if bonus, e := OrderBaseDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
70 p.CareerOrdersCount = int(bonus.Total) 70 p.CareerOrdersCount = int(bonus.Total)
71 p.CareerOrdersMoney = utils.Decimal(bonus.TotalOrderAmount) 71 p.CareerOrdersMoney = utils.Decimal(bonus.TotalOrderAmount)
72 p.CareerDividend = utils.Decimal(bonus.Bonus) 72 p.CareerDividend = utils.Decimal(bonus.Bonus)
73 } 73 }
74 - if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, IsDisable: 1}); e == nil { 74 + if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: userId, IsDisable: 1, EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
75 p.BusinessOrdersCount = int(businessBonus.Total) 75 p.BusinessOrdersCount = int(businessBonus.Total)
76 p.BusinessOrdersMoney = utils.Decimal(businessBonus.TotalOrderAmount) 76 p.BusinessOrdersMoney = utils.Decimal(businessBonus.TotalOrderAmount)
77 p.BusinessDividend = utils.Decimal(businessBonus.Bonus) 77 p.BusinessDividend = utils.Decimal(businessBonus.Bonus)
@@ -238,12 +238,12 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) { @@ -238,12 +238,12 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) {
238 return response, nil 238 return response, nil
239 } 239 }
240 240
241 - totalBonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), OrderTypes: domain.UserOrderTypes(domain.Career)}) 241 + totalBonus, e := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000})
242 if e != nil { 242 if e != nil {
243 return response, e 243 return response, e
244 } 244 }
245 245
246 - if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), IsDisable: 1}); e == nil { 246 + if businessBonus, e := BusinessBonusDao.OrderBonusStatics(domain.OrderBonusQuery{InPartnerIds: doGetPartnerIds(), IsDisable: 1, EndTime: utils.GetDayEnd().Unix() * 1000}); e == nil {
247 totalBonus.Bonus += businessBonus.Bonus 247 totalBonus.Bonus += businessBonus.Bonus
248 } 248 }
249 249
@@ -290,7 +290,7 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) { @@ -290,7 +290,7 @@ func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) {
290 continue 290 continue
291 } 291 }
292 292
293 - bonus, _ := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: partner.Id, OrderTypes: domain.UserOrderTypes(domain.Career)}) 293 + bonus, _ := OrderDao.OrderBonusStatics(domain.OrderBonusQuery{PartnerId: partner.Id, OrderTypes: domain.UserOrderTypes(domain.Career), EndTime: utils.GetDayEnd().Unix() * 1000})
294 if v, ok := mapPartnerBussinessBonus[partner.Id]; ok { 294 if v, ok := mapPartnerBussinessBonus[partner.Id]; ok {
295 bonus.Bonus += v.Bonus 295 bonus.Bonus += v.Bonus
296 } 296 }