diff --git a/Application/Admin/Controller/StatementWarningController.class.php b/Application/Admin/Controller/StatementWarningController.class.php index 90804400d..8790f5089 100644 --- a/Application/Admin/Controller/StatementWarningController.class.php +++ b/Application/Admin/Controller/StatementWarningController.class.php @@ -53,11 +53,12 @@ class StatementWarningController extends AdminController private function getLastUpdate() { - $preMonth = explode('-',date('Y-m',mktime(0,0,0,date('m',time()),1,date('Y',time()))-1)); + $time =strtotime(date('Y',time()).'-'.date('m',time())."-1"); + $nextMonth = explode('-', date('Y-m',strtotime('+32 day',$time)) ); $lastUpdate = $this->statementWarningModel->where([ - 'count_year'=>$preMonth[0], - 'count_month'=>$preMonth[1], + 'count_year'=>$nextMonth[0], + 'count_month'=>$nextMonth[1], "name"=>'wm_platm', "type"=>1 ])->field("create_time")->find(); @@ -308,8 +309,8 @@ class StatementWarningController extends AdminController { if(!isset($_REQUEST['time'])) $this->error("参数错误"); - $time =strtotime($_REQUEST['time']."-1"); - $time = date('Y-m',strtotime('+32 day',$time)); + $time =strtotime($_REQUEST['time']."-1")-1; + $time = date('Y-m',$time); $params = "php ".SUBSITE_INDEX." StatementWarningSet/setFreeMonth/count_date/{$time}"; $r = D("CmdTasks")->addTask("StatementWarningSet",$params); @@ -422,11 +423,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)); - + $time =strtotime($info['count_year'].'-'.$info['count_month']."-1"); + $nextMonth = explode('-', date('Y-m',strtotime('+32 day',$time)) ); $this->statementWarningModel->where([ - 'count_year'=>$preMonth[0], - 'count_month'=>$preMonth[1], + 'count_year'=>$nextMonth[0], + 'count_month'=>$nextMonth[1], 'name'=>$poolname, ])->setDec('money',$diffMoney); } diff --git a/Application/Admin/Controller/StatementWarningSetController.class.php b/Application/Admin/Controller/StatementWarningSetController.class.php index 4591b3c82..69f8502d6 100644 --- a/Application/Admin/Controller/StatementWarningSetController.class.php +++ b/Application/Admin/Controller/StatementWarningSetController.class.php @@ -68,15 +68,16 @@ class StatementWarningSetController extends Controller { $count_date = date('Y',time()).'-'.(date('m',time())); $this->configInit($count_date); - $preMonth = $this->getPreMonth(); + $nextMonth = $this->getNextMonth(); $hasdb = $this->statementWarningModel->where([ - 'count_year'=>$preMonth[0], - 'count_month'=>$preMonth[1], + 'count_year'=>$nextMonth[0], + 'count_month'=>$nextMonth[1], "name"=>'wm_platm', "type"=>1 ])->find(); if(!$hasdb){ //第一次生成,同时上一次结扎 + $preMonth = $this->getPreMonth(); $preCountMonth = $preMonth[0]."-".$preMonth[1]; $params = "php ".SUBSITE_INDEX." StatementWarningSet/setFreeMonth/count_date/{$preCountMonth}"; $time = time()+2*3600; @@ -366,12 +367,12 @@ class StatementWarningSetController extends Controller { private function addStatementWarning($type,$name,$money,$issave = true) { //汇总表差一个月 - $preMonth = $this->getPreMonth(); + $nextMonth = $this->getNextMonth(); $savedata = [ 'type'=>$type, 'name'=>$name, - 'count_year'=>$preMonth[0], - 'count_month'=>$preMonth[1] + 'count_year'=>$nextMonth[0], + 'count_month'=>$nextMonth[1] ]; $hasDb = $this->statementWarningModel->where($savedata)->find(); $savedata = array_merge(['money'=>$money,'create_time'=>time()],$savedata); @@ -440,7 +441,10 @@ class StatementWarningSetController extends Controller { return explode('-',date("Y-m",$this->beginThismonth-1)); } - + private function getNextMonth() + { + return explode('-',date("Y-m",$this->endThismonth+1)); + } diff --git a/Application/Admin/View/StatementWarning/lists.html b/Application/Admin/View/StatementWarning/lists.html index 581012d53..1aba87700 100644 --- a/Application/Admin/View/StatementWarning/lists.html +++ b/Application/Admin/View/StatementWarning/lists.html @@ -53,7 +53,7 @@
每日凌晨五点自动更新,如需获取时时数据,请手动进行【月份重算】/ 预警月份与时时表差一个月
+每日凌晨五点自动更新,如需获取时时数据,请手动进行【月份重算】/ 预警月份与时时表大一个月