From a1fa0afee57a05cf7028c36bfcf12b2f7deec170 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Aug 2021 11:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=9E=E6=97=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/StatementWarningController.class.php | 8 +++++--- Application/Admin/View/StatementWarning/lists.html | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/StatementWarningController.class.php b/Application/Admin/Controller/StatementWarningController.class.php index f73eb0c15..b4a325d5e 100644 --- a/Application/Admin/Controller/StatementWarningController.class.php +++ b/Application/Admin/Controller/StatementWarningController.class.php @@ -353,7 +353,7 @@ class StatementWarningController extends AdminController private function getMonthLastUpdate($year,$month) { - $lastUpdate = $this->statementWarningModel->where([ + $lastUpdate = $this->statementWarningInfoModel->where([ 'count_year'=>$year, 'count_month'=>$month, ])->field("MAX(create_time) create_time")->find(); @@ -403,9 +403,11 @@ class StatementWarningController extends AdminController $poolname = 'up_statement'; } + $preMonth = explode('-',date('Y-m',mktime(0,0,0,$info['count_month'],1,$info['count_year'])-1)); + $this->statementWarningModel->where([ - 'count_year'=>$info['count_year'], - 'count_month'=>$info['count_month'], + 'count_year'=>$preMonth[0], + 'count_month'=>$preMonth[1], 'name'=>$poolname, ])->setDec('money',$diffMoney); } diff --git a/Application/Admin/View/StatementWarning/lists.html b/Application/Admin/View/StatementWarning/lists.html index 32565a3e6..8c08b052e 100644 --- a/Application/Admin/View/StatementWarning/lists.html +++ b/Application/Admin/View/StatementWarning/lists.html @@ -241,8 +241,8 @@ layer.msg('要重算的月份必须小于当前时间'); return false; } - if(subtimeArr[0] == year && subtimeArr[1] > month){ - layer.msg('要重算的月份必须小于当前时间'); + if(subtimeArr[0] == year && subtimeArr[1] >= month){ + layer.msg('要重算的月份必须小于当前月份'); return false; }