...
|
...
|
@@ -668,15 +668,15 @@ func (ptr *CooperationStatisticsService) PaymentHistoryHistogramStatistics(query |
|
|
if !request.BeginTime.IsZero() && request.BeginTime.AddDate(0, 3, 0).Before(request.EndTime) {
|
|
|
queryItems, xAxisData = histogramStatisticsByYear(request.BeginTime)
|
|
|
} else {
|
|
|
queryItems, xAxisData = histogramStatisticsByMonth()
|
|
|
queryItems, xAxisData = histogramStatisticsByMonth(request.BeginTime)
|
|
|
}
|
|
|
for i := range queryItems {
|
|
|
item := queryItems[i]
|
|
|
if len(contractNumbers) == 0 && request.UserId > 0 { //没有相关的合约 查看分红预算单为空
|
|
|
continue
|
|
|
}
|
|
|
queryOptions["beginTime"] = item.BeginTime
|
|
|
queryOptions["endTime"] = item.EndTime
|
|
|
queryOptions["paymentBeginTime"] = item.BeginTime
|
|
|
queryOptions["paymentEndTime"] = item.EndTime
|
|
|
if err := creditAccountDao.DividendsStatistics(queryOptions, dividends); err != nil {
|
|
|
return nil, err
|
|
|
}
|
...
|
...
|
@@ -697,9 +697,9 @@ type queryItem struct { |
|
|
EndTime time.Time
|
|
|
}
|
|
|
|
|
|
func histogramStatisticsByMonth() ([]queryItem, []string) {
|
|
|
func histogramStatisticsByMonth(start time.Time) ([]queryItem, []string) {
|
|
|
ret := make([]queryItem, 0)
|
|
|
year, month := time.Now().Year(), time.Now().Month()
|
|
|
year, month := start.Year(), start.Month()
|
|
|
var beginTime = time.Date(year, month, 1, 0, 0, 0, 0, time.Local)
|
|
|
var endTime time.Time
|
|
|
var increaseDay = 5
|
...
|
...
|
|