From 15373077b71cee068406550ecdf7c7614bb6febe Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 19 Nov 2019 15:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=AE=A1=E7=90=86->=E6=AF=8F=E6=97=A5=E6=A6=82?= =?UTF-8?q?=E5=86=B5|=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB--=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Repository/UserRepository.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Application/Base/Repository/UserRepository.class.php b/Application/Base/Repository/UserRepository.class.php index 91f189e5a..3243cbb03 100644 --- a/Application/Base/Repository/UserRepository.class.php +++ b/Application/Base/Repository/UserRepository.class.php @@ -131,9 +131,9 @@ class UserRepository public function getLoginCountGroupByDayNew($params) { $dayList = $params['dayList'] ?? []; - $params['time_column'] = 'login_time'; + $params['time_column'] = 'create_time'; $conditions = $this->getDayGroupConditions($params); - $items = M('user_login_record', 'tab_')->field('FROM_UNIXTIME(login_time, "%Y-%m-%d") as day, count(DISTINCT user_id, game_id) as count') + $items = M('login_daily_record', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day, count(DISTINCT user_id, game_id) as count') ->where($conditions) ->group('day') ->select(); @@ -147,17 +147,17 @@ class UserRepository public function getLoginCountGroupByGame($params) { $gameIds = $params['game_ids'] ?? []; - $params['time_column'] = 'login_time'; + $params['time_column'] = 'create_time'; $conditions = $this->getGameGroupConditions($params); if (isset($params['all_data'])) { - $sql = M('user_login_record', 'tab_')->field('distinct game_id, user_id') + $sql = M('login_daily_record', 'tab_')->field('distinct game_id, user_id') ->where($conditions) ->fetchSql(true) ->select(); $model = new \Think\Model(); return $model->query("select count(*) as num from ($sql) as t")[0]['num']; } else { - $items = M('user_login_record', 'tab_')->field('game_id, count(DISTINCT user_id) as count') + $items = M('login_daily_record', 'tab_')->field('game_id, count(DISTINCT user_id) as count') ->where($conditions) ->group('game_id') ->select();