diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 9ccebc9f9..e355f61b9 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -129,29 +129,14 @@ class ConsoleController extends Think { public function deleteRepeatUserPlayInfo() { - /* INSERT INTO `tab_server`(`game_id`, `game_name`, `server_name`, `server_num`, `recommend_status`, `show_status`, `stop_status`, `server_status`, `icon`, `start_time`, `desride`, `prompt`, `parent_id`, `create_time`, `server_version`, `developers`, `server_id`) VALUES - (148, '王者纷争(安卓版)', 'O3-潜龙于渊', 3294, 1, 1, 0, 0, NULL, 1571399818, NULL, NULL, NULL, 1571399818, 1, 0, '3294'), - (148, '王者纷争(安卓版)', 'O4-攻心为上', 3301, 1, 1, 0, 0, NULL, 1571399818, NULL, NULL, NULL, 1571399818, 1, 0, '3301'), - (148, '王者纷争(安卓版)', 'O5-知人善用', 3311, 1, 1, 0, 0, NULL, 1571399818, NULL, NULL, NULL, 1571399818, 1, 0, '3311'), - (148, '王者纷争(安卓版)', 'O8-剑拔弩张', 3332, 1, 1, 0, 0, NULL, 1571399818, NULL, NULL, NULL, 1571399818, 1, 0, '3332'), - (148, '王者纷争(安卓版)', 'O12-七擒七纵', 3336, 1, 1, 0, 0, NULL, 1571399818, NULL, NULL, NULL, 1571399818, 1, 0, '3336'), - (148, '王者纷争(安卓版)', 'O15-遮空蔽日', 3375, 1, 1, 0, 0, NULL, 1571399818, NULL, NULL, NULL, 1571399818, 1, 0, '3375'); */ + $gameIds = [157, 155, 153, 150, 151, 148, 175, 142, 143, 172, 173, 155, 154]; + foreach($gameIds as $gameId) { + $this->doDeleteRepeatUserPlayInfo($gameId); + } + } - // $gameId = 157; - // $gameId = 155; - // $gameId = 153; - // $gameId = 150; - // $gameId = 151; - // 需要先执行上面sql插入区服才能清理干净 - // $gameId = 148; - // $gameId = 175; - // $gameId = 142; - // $gameId = 143; - // $gameId = 172; - // $gameId = 173; - // $gameId = 155; - // $gameId = 154; - $gameId = 153; + public function doDeleteRepeatUserPlayInfo() + { $sql = 'select id from tab_user_play_info a left join ( select role_id, server_id, game_id, count(1) from tab_user_play_info where server_id="' . $serverId . '" and game_id = ' . $gameId . ' GROUP BY role_id, server_id, game_id, server_name having count(1) > 1 ) b on a.role_id=b.role_id where a.server_id=b.server_id and a.game_id=b.game_id and a.server_id="' . $serverId . '" and a.game_id = ' . $gameId . ' order by a.role_id, a.server_id, a.game_id'; @@ -198,24 +183,14 @@ class ConsoleController extends Think { public function deleteRepeatUserPlayInfo2() { - // $gameId = 157; - // $gameId = 148; - // $gameId = 150; - // $gameId = 151; - // $gameId = 158; - // $gameId = 175; - // $gameId = 142; - // $gameId = 143; - // $gameId = 172; - // $gameId = 173; - // $gameId = 154; - // $gameId = 155; - // $gameId = 176; - // $gameId = 165; - // $gameId = 164; - // $gameId = 179; - // $gameId = 156; - $gameId = 153; + $gameIds = [157, 148, 150, 151, 158, 175, 142, 143, 172, 173, 154, 155, 176, 165, 164, 179, 156, 153]; + foreach ($gameIds as $gameId) { + $this->doDeleteRepeatUserPlayInfo2(); + } + } + + public function doDeleteRepeatUserPlayInfo2() + { $sql = 'select id from tab_user_play_info a left join ( select role_id, server_id, game_id, count(1) from tab_user_play_info where server_id="' . $serverId . '" and game_id = ' . $gameId . ' GROUP BY role_id, server_id, game_id, server_name having count(1) > 1 ) b on a.role_id=b.role_id where a.server_id=b.server_id and a.game_id=b.game_id and a.server_id="' . $serverId . '" and a.game_id = ' . $gameId . ' order by a.role_id, a.server_id, a.game_id';