|
@@ -28,14 +28,29 @@ class UserLogLogic extends BaseLogic
|
|
|
$currentQuery = Db::connect('db_game_log');
|
|
$currentQuery = Db::connect('db_game_log');
|
|
|
foreach($tableNames as $index => $tableName){
|
|
foreach($tableNames as $index => $tableName){
|
|
|
if($index === 0){
|
|
if($index === 0){
|
|
|
- $currentQuery = $currentQuery->table($tableName)->field('*')->where($where)->whereRaw($whereRaw);
|
|
|
|
|
|
|
+ $currentQuery = $currentQuery->table($tableName);
|
|
|
|
|
+ if($where){
|
|
|
|
|
+ $currentQuery = $currentQuery->where($where);
|
|
|
|
|
+ }
|
|
|
|
|
+ if($whereRaw){
|
|
|
|
|
+ $currentQuery = $currentQuery->whereRaw($whereRaw);
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
- $currentQuery->unionAll($currentQuery->table($tableName)->field('*')->where($where)->whereRaw($whereRaw));
|
|
|
|
|
|
|
+ $currentQuery = $currentQuery->unionAll(function($query) use ($tableName, $where, $whereRaw){
|
|
|
|
|
+ $query = $query->table($tableName);
|
|
|
|
|
+ if($where){
|
|
|
|
|
+ $query = $query->where($where);
|
|
|
|
|
+ }
|
|
|
|
|
+ if($whereRaw){
|
|
|
|
|
+ $query = $query->whereRaw($whereRaw);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- // echo $currentQuery->buildSql();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ echo $currentQuery->buildSql();
|
|
|
// exit;
|
|
// exit;
|
|
|
|
|
|
|
|
|
|
|