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 {