From a9308167d79c72cd0821387f023c64b9bc2926c5 Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Thu, 2 Aug 2018 18:10:52 +0800 Subject: [PATCH] fix bug --- .../mappers/CustomerAndOrdersStatisticsMapper.xml | 2 +- .../ui/static/analysis/trans-analysis-monthly.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml index fc20ac668..585bc9238 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml @@ -331,7 +331,7 @@ ) and s.date >= #{begin} - and s.date < #{end} + and s.date <= #{end} and c.org_id=#{org_id} and c.org_id in #{org_id} diff --git a/src/main/ui/static/analysis/trans-analysis-monthly.js b/src/main/ui/static/analysis/trans-analysis-monthly.js index a53eb2a79..c1bccba7c 100644 --- a/src/main/ui/static/analysis/trans-analysis-monthly.js +++ b/src/main/ui/static/analysis/trans-analysis-monthly.js @@ -67,7 +67,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an params.begin = $filter('date')(new Date(), 'yyyyMMdd'); } if (params.end) { - params.end = $filter('date')(params.end.setMonth(params.end.getMonth()+1), 'yyyyMMdd'); + params.end = $filter('date')(getLastDay(params.end.getFullYear(),params.end.getMonth()), 'yyyyMMdd'); } else { params.end = $filter('date')(new Date(), 'yyyyMMdd'); } @@ -80,6 +80,19 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an $scope.totalChannelAmount = resp.data; }); }; + + function getLastDay(year,month) + { + var new_year = year; //取当前的年份 + var new_month = ++month;//取下一个月的第一天,方便计算(最后一天不固定) + if(month>11) //如果当前大于12月,则年份转到下一年 + { + new_month -=12; //月份减 + new_year++; //年份增 + } + var new_date = new Date(new_year,new_month,1); //取当年当月中的第一天 + return new Date(new_date.getTime()-1000*60*60*24);//获取当月最后一天日期 + } $scope.thisYear(); var ordersHistoryConfig = { chart: {