diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index 31037e19a..c704aec94 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -1034,65 +1034,4 @@ public function auto_rrdae(){ ]; return $ret; } - - //玩家角色每日登录记录 - public function userPlayLoginRecordByDayCount($time = '') - { - if ($time == '') { - $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); - } else { - $time = strtotime(date('Y-m-d 00:00:00', strtotime($time))); - } - $res = M('user_play_login_record_by_day', 'tab_')->where(array('create_time' => $time))->find(); - if (empty($res)) { - $map['login_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; - - $this->userPlayLoginRecordByDayByMap($map); - } - } - - //玩家角色每日登录记录--初始化 - public function userPlayLoginRecordByDayInitial() - { - $res = M('user_play_login_record_by_day', 'tab_')->order('id asc')->find(); - if (empty($res)) { - ini_set('memory_limit','800M'); - $time = strtotime(date('Y-m-d 00:00:00', time())); - $map['login_time'] = ['lt', $time]; - - $this->userPlayLoginRecordByDayByMap($map); - echo '初始化成功'; - } else { - echo '表存在记录,无法初始化'; - } - } - - //玩家角色每日登录记录 - private function userPlayLoginRecordByDayByMap($map = []) - { - if (isset($map['login_time'])) { - $map['game_id'] = ['gt', 0]; - $field = 'FROM_UNIXTIME(login_time, "%Y-%m-%d") as day,user_id,game_id'; - $loginData = M('user_game_login_record', 'tab_')->field($field) - ->where($map) - ->group('day,game_id,user_id') - ->select(); - - if (!empty($loginData)) { - $data = []; - foreach ($loginData as &$list) { - $data[] = [ - 'user_id' => $list['user_id'], - 'game_id' => $list['game_id'], - 'server_id' => '', - 'role_id' => '', - 'create_time' => strtotime($list['day']), - ]; - unset($list); - } - unset($loginData); - M('user_play_login_record_by_day', 'tab_')->addAll($data); - } - } - } } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index b667996d0..2d52f6888 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1859,7 +1859,7 @@ class QueryController extends BaseController $loginRecordMap['lr.create_time'] = $map['uc.create_time']; $loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id'; - $fieldLR = M('user_play_login_record_by_day', 'tab_')->alias('lr') + $fieldLR = M('login_daily_record', 'tab_')->alias('lr') ->field("count(*) as count") ->where($loginRecordMap) ->buildSql(); diff --git a/Data/update.sql b/Data/update.sql index 49226d3df..95adabd49 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -698,16 +698,3 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMME ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号'; -- 菜单(游戏充值预下单) INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); - ---2019-12-11 cxj ---玩家角色每日登录记录表 -CREATE TABLE `tab_user_play_login_record_by_day` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '玩家id', - `game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id', - `server_id` varchar(30) NOT NULL DEFAULT '' COMMENT '区服id', - `role_id` varchar(30) NOT NULL DEFAULT '' COMMENT '角色id', - `create_time` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `search`(`user_id`, `game_id`, `create_time`) USING BTREE -); \ No newline at end of file