优化实时修改

master
chenzhi 3 years ago
parent 3459e20313
commit a1fa0afee5

@ -353,7 +353,7 @@ class StatementWarningController extends AdminController
private function getMonthLastUpdate($year,$month) private function getMonthLastUpdate($year,$month)
{ {
$lastUpdate = $this->statementWarningModel->where([ $lastUpdate = $this->statementWarningInfoModel->where([
'count_year'=>$year, 'count_year'=>$year,
'count_month'=>$month, 'count_month'=>$month,
])->field("MAX(create_time) create_time")->find(); ])->field("MAX(create_time) create_time")->find();
@ -403,9 +403,11 @@ class StatementWarningController extends AdminController
$poolname = 'up_statement'; $poolname = 'up_statement';
} }
$preMonth = explode('-',date('Y-m',mktime(0,0,0,$info['count_month'],1,$info['count_year'])-1));
$this->statementWarningModel->where([ $this->statementWarningModel->where([
'count_year'=>$info['count_year'], 'count_year'=>$preMonth[0],
'count_month'=>$info['count_month'], 'count_month'=>$preMonth[1],
'name'=>$poolname, 'name'=>$poolname,
])->setDec('money',$diffMoney); ])->setDec('money',$diffMoney);
} }

@ -241,8 +241,8 @@
layer.msg('要重算的月份必须小于当前时间'); layer.msg('要重算的月份必须小于当前时间');
return false; return false;
} }
if(subtimeArr[0] == year && subtimeArr[1] > month){ if(subtimeArr[0] == year && subtimeArr[1] >= month){
layer.msg('要重算的月份必须小于当前时间'); layer.msg('要重算的月份必须小于当前月份');
return false; return false;
} }

Loading…
Cancel
Save