|
|
@@ -35,20 +35,12 @@ class UserLogLogic extends BaseLogic
|
|
|
throw new ApiException('注册时间只能查询3个月内');
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 公共处理完的where, 自然量ID, auth_id=0为自然量
|
|
|
$whereRaw = $this->getCommonWhereRaw($params);
|
|
|
$monthRange = getMonthRange($params['reg_time'][0], $params['reg_time'][1]);
|
|
|
|
|
|
- $db = Db::connect('db_game_log');
|
|
|
- $unionQuery = [];
|
|
|
- foreach ($monthRange as $month){
|
|
|
- $tableName = 'sdk_reg_log_' . $month;
|
|
|
- $unionQuery[] = $db->table($tableName)->whereRaw(where: $whereRaw)->buildSql();
|
|
|
- }
|
|
|
- $fullSql = "(" . implode(' UNION ALL ', $unionQuery) . ") as unTable";
|
|
|
-
|
|
|
- return $db->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
|
|
|
+ $fullSql = $this->generateUnionSql('sdk_reg_log', $monthRange, $whereRaw);
|
|
|
+ return Db::connect('db_game_log')->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
|
|
|
}
|
|
|
|
|
|
// 登录日志
|
|
|
@@ -95,15 +87,9 @@ class UserLogLogic extends BaseLogic
|
|
|
$whereRaw = $this->getCommonWhereRaw($params);
|
|
|
$monthRange = getMonthRange($params['login_time'][0], $params['login_time'][1]);
|
|
|
|
|
|
- $db = Db::connect('db_game_log');
|
|
|
- $unionQuery = [];
|
|
|
- foreach ($monthRange as $month){
|
|
|
- $tableName = 'sdk_login_log_' . $month;
|
|
|
- $unionQuery[] = $db->table($tableName)->whereRaw(where: $whereRaw)->buildSql();
|
|
|
- }
|
|
|
- $fullSql = "(" . implode(' UNION ALL ', $unionQuery) . ") as unTable";
|
|
|
+ $fullSql = $this->generateUnionSql('sdk_login_log', $monthRange, $whereRaw);
|
|
|
|
|
|
- return $db->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
|
|
|
+ return Db::connect('db_game_log')->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
|
|
|
}
|
|
|
|
|
|
// 充值明细
|
|
|
@@ -111,7 +97,6 @@ class UserLogLogic extends BaseLogic
|
|
|
{
|
|
|
$orderBy = request()->input('orderBy', 'pay_date');
|
|
|
$orderType = request()->input('orderType', 'desc');
|
|
|
- $page = request()->input('page', 1);
|
|
|
$limit = request()->input('limit', 10);
|
|
|
|
|
|
$params = $this->searchByAuth($where);
|
|
|
@@ -274,7 +259,6 @@ class UserLogLogic extends BaseLogic
|
|
|
|
|
|
public function getRoleDataList($params): mixed
|
|
|
{
|
|
|
- $page = request()->input('page', 1);
|
|
|
$limit = request()->input('limit', 10);
|
|
|
$orderBy = request()->input('orderBy', 'create_time');
|
|
|
$orderType = request()->input('orderType', 'desc');
|
|
|
@@ -285,13 +269,8 @@ class UserLogLogic extends BaseLogic
|
|
|
$whereRaw = $this->getCommonWhereRaw($params);
|
|
|
$tables = ['role_data_and', 'role_data_ios'];
|
|
|
|
|
|
- $db = Db::connect('db_game_log');
|
|
|
- $unionQuery = [];
|
|
|
- foreach ($tables as $tableName){
|
|
|
- $unionQuery[] = $db->table($tableName)->whereRaw(where: $whereRaw)->buildSql();
|
|
|
- }
|
|
|
- $fullSql = "(" . implode(' UNION ALL ', $unionQuery) . ") as unTable";
|
|
|
+ $fullSql = $this->generateUnionSql('', $tables, $whereRaw);
|
|
|
|
|
|
- return $db->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
|
|
|
+ return Db::connect('db_game_log')->table($fullSql)->order($orderBy, $orderType)->paginate($limit)->toArray();
|
|
|
}
|
|
|
}
|