From 899877e8724914d3ff61df97aa25190383212444 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Fri, 27 Dec 2019 16:54:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ConsoleController.class.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 3fd04ec0b..e9b103c37 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -101,12 +101,19 @@ class ConsoleController extends Think { $this->modifyLogin(strtotime($start_time)); } + public function modifyLoginCheck($start_time=0, $end_time=0) + { + $start_time = $start_time ? strtotime($start_time) : strtotime(date("Y-m-d")); + $end_time = $end_time ? strtotime($end_time) : $start_time + 86400; + $this->modifyLogin($start_time, $end_time); + } + /** * 登录校验 */ - private function modifyLogin($start_time=0) + private function modifyLogin($start_time=0, $end_time=0) { - $current_time = strtotime(date("Y-m-d"))-86400; + $current_time = $end_time?: strtotime(date("Y-m-d"))-86400; for ($i=$start_time; $i<=$current_time; $i+=86400) { $end_time = $i+86400; $result = M()->query("SELECT @@ -115,9 +122,16 @@ class ConsoleController extends Think { user_id, promote_id FROM - tab_user_login_record + tab_user_login_record ulr WHERE login_time >= {$i} and login_time < {$end_time} + AND NOT EXISTS ( + SELECT + id + FROM + tab_login_daily_record ldr + where ldr.create_time >= {$i} and ldr.create_time < {$end_time} and ldr.game_id = ulr.game_id and ldr.user_id = ulr.user_id and ldr.promote_id = ulr.promote_id + ) GROUP BY create_time, game_id, @@ -131,6 +145,7 @@ class ConsoleController extends Think { } else { echo "写入{$item['create_time']} error \n"; } + unset($result[$index]); } } else {