From e39c811da8dc6c2edb3134ef4e6111afa1c58ceb Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 2 Jan 2020 11:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=88=E7=BB=93=E6=9C=88?= =?UTF-8?q?=E4=BB=BD=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/SpendCountSetController.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index 2ea622e92..16dd8f585 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -18,7 +18,8 @@ class SpendCountSetController extends \Think\Controller //初始化 $this->beginThismonth = mktime(0,0,0,date('m')-1,1,date('Y')); $this->endThismonth = mktime(0,0,0,date('m'),1,date('Y'))-1; - $this->date = date('Y')."-".((date('m')-1) > 9 ? (date('m')-1) : "0".(date('m')-1)); + $temp = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month'))); + $this->date = date('Y',$temp)."-".date('m',$temp); $this->nowdata =time(); $this->model =M(); $this->usermodel =M("spend_user_count",'tab_');