作者 yangfu

修改: 分红统计增加业务分红

@@ -42,6 +42,14 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis @@ -42,6 +42,14 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis
42 // 业务分红统计 42 // 业务分红统计
43 if bonus, e := BusinessBonusRepository.FindOne(map[string]interface{}{"partner_id": header.UserId, "isDisable": 1}); e == nil { 43 if bonus, e := BusinessBonusRepository.FindOne(map[string]interface{}{"partner_id": header.UserId, "isDisable": 1}); e == nil {
44 bonusAll.Receivable += bonus.Bonus 44 bonusAll.Receivable += bonus.Bonus
  45 + bonusAll.Received += bonus.BonusHas
  46 + bonusAll.Outstanding += bonus.BonusNot
  47 + if bonus.UpdateAt.Unix() >= (request.StartTime/1000) && bonus.UpdateAt.Unix() < (request.EndTime/1000) {
  48 + q := quarter(bonus.UpdateAt)
  49 + bonusQuarters[q].Receivable += bonus.Bonus
  50 + bonusQuarters[q].Received += bonus.BonusHas
  51 + bonusQuarters[q].Outstanding += bonus.BonusNot
  52 + }
45 } 53 }
46 54
47 rsp = &protocol.DividendStatisticsResponse{} 55 rsp = &protocol.DividendStatisticsResponse{}