From 185f0ca30e6846da2b59fe9a05be78bdaf2c62f2 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Wed, 30 Oct 2019 11:29:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=BA=E5=88=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SpendCountSetController.class.php | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index 97ebf2131..d797ad0d5 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -29,9 +29,6 @@ class SpendCountSetController extends \Think\Controller */ public function setMonthSpendCount() { - set_time_limit(0); - $t1 = microtime(true); - $month = I("count_date"); if(empty($month)) die("参数错误"); @@ -39,25 +36,8 @@ class SpendCountSetController extends \Think\Controller $tarry = explode('-',$month); $this->beginThismonth=mktime(0,0,0,$tarry[1],1,$tarry[0]); $this->endThismonth=mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1; - //判断是否已经聚合 - $countRes = M("spend_count","tab_")->field("count(*) date_count")->where("count_date = '{$this->date}'")->find()['date_count']; - $countUserRes = M("spend_user_count","tab_")->field("count(*) date_count")->where("count_date = '{$this->date}'")->find()['date_count']; - if($countRes > 0 || $countUserRes >0){ - die("error:Repeated statistics"); - } - $this->model->startTrans(); - $this->usermodel->startTrans(); - $this->continue =true; - //执行游戏表统计 - $this->setGameCount(); - //执行用户表统计 - $this->setUserCount(); - //执行 - $this->model->commit(); - $this->usermodel->commit(); - - $t2 = microtime(true); - die("success runtime:".round($t2-$t1,3).'s'); + + $this->setSpendCount(); } /**