Explorar o código

分时数据,搜索

ith5 hai 5 meses
pai
achega
6d733298ee
Modificáronse 1 ficheiros con 4 adicións e 8 borrados
  1. 4 8
      app/v1/logic/gameLog/ChannelAnalysisLogic.php

+ 4 - 8
app/v1/logic/gameLog/ChannelAnalysisLogic.php

@@ -40,6 +40,7 @@ class channelAnalysisLogic extends BaseLogic
         $group = 'agent_id,thour';
         $whereSql = $this->generateWhereSql($params);
 
+
         // 根据日期,连表查询
         $tableNames = ToolLogic::getMonthlyTableNames('base_total_hour_', $where['reg_date'][0], $where['reg_date'][1]);
         $sqlParts = [];
@@ -57,13 +58,10 @@ class channelAnalysisLogic extends BaseLogic
             GROUP BY {$group}
             ORDER BY {$orderBy}
         ";
+
         // 按小时数据
         $hourData = Db::connect('db_data_report')->query($finalSql);
 
-        // 按天消耗数据,查询消耗表,得出每天的消耗数据,agent_id分组
-//        $finalDayCostSql = "SELECT SUM(money)  as cost FROM media_cost WHERE 1=1 {$whereSql} group by agent_id";
-//        $dayCostData = Db::connect('db_advert')->query($finalDayCostSql);
-
         $total=[
             'agent_id'=>'合计'
         ];
@@ -132,14 +130,12 @@ class channelAnalysisLogic extends BaseLogic
         array_unshift($data, $total);
         return $data;
 
-
-
-
     }
 
 
     // 生成wheresql
     public function generateWhereSql($params){
+        print_r($params);
         $startDate = $params['reg_date'][0];
         $endDate = $params['reg_date'][1];
         $whereSql = "";
@@ -170,7 +166,7 @@ class channelAnalysisLogic extends BaseLogic
                 $whereSql .= " AND auth_id = {$params['auth_id']}";
             }
         }
-        if(!empty($params['red_date'])){
+        if(!empty($params['reg_date'])){
             $whereSql .= " AND tdate BETWEEN '{$startDate}' AND '{$endDate}'";
         }