Explorar el Código

Merge commit '5524378c020e7969a3d0beca4568888d39ba4e82' into dev

ith5 hace 5 meses
padre
commit
39b5d9cbc2

+ 1 - 0
app/process/CreateTables.php

@@ -234,6 +234,7 @@ class CreateTables
   `agent_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '渠道id',
   `site_id` int(10) unsigned NOT NULL DEFAULT '1000' COMMENT '广告位id',
   `auth_id` int(11) NOT NULL DEFAULT '0' COMMENT '负责人ID',
+  `activate_time` int(11) NOT NULL,
   `imei` varchar(64) DEFAULT '' COMMENT 'imei/idfa',
   `oaid` varchar(128) DEFAULT '' COMMENT 'oaid/cid',
   `ip` varchar(128) NOT NULL DEFAULT '',

+ 18 - 0
app/v1/logic/tool/dataReport/BaseTotalDayDataReportLogic.php

@@ -78,6 +78,8 @@ class BaseTotalDayDataReportLogic extends BaseDataReportLogic
         // 重置数据
         $this->data = [];
 
+        $this->installData();
+
         $this->regData();
 
         $this->loginData();
@@ -93,6 +95,22 @@ class BaseTotalDayDataReportLogic extends BaseDataReportLogic
         $this->replaceData(['tdate'=>$this->date]);
     }
 
+    // 激活数
+    protected function installData()
+    {
+        $sTime = strtotime("{$this->date} 00:00:00");
+        $eTime = strtotime("{$this->date} 23:59:59");
+
+        $regTotalTb = "sdk_activate_log_" . date('Ym', strtotime($this->date));
+        $filed = "game_id, agent_id, site_id, '{$this->date}' as tdate, count(distinct concat(imei, oaid)) as install";
+
+        $where = [
+            ['activate_time', 'between', [$sTime, $eTime]],
+        ];
+        $result = Db::connect('db_game_log')->table($regTotalTb)->field($filed)->where($where)->group($this->group)->select();
+        $this->pushData($result);
+    }
+
     protected function regData()
     {
         $sTime = strtotime("{$this->date} 00:00:00");

+ 18 - 0
app/v1/logic/tool/dataReport/BaseTotalHourDataReportLogic.php

@@ -76,6 +76,8 @@ class BaseTotalHourDataReportLogic extends BaseDataReportLogic
         // 重置数据
         $this->data = [];
 
+        $this->installData();
+
         $this->regData();
 
         $this->loginData();
@@ -93,6 +95,22 @@ class BaseTotalHourDataReportLogic extends BaseDataReportLogic
         $this->replaceData(['tdate'=>$this->date, 'thour'=>$this->hour]);
     }
 
+    // 激活数
+    protected function installData()
+    {
+        $sTime = strtotime("{$this->date} 00:00:00");
+        $eTime = strtotime("{$this->date} 23:59:59");
+
+        $regTotalTb = "sdk_activate_log_" . date('Ym', strtotime($this->date));
+        $filed = "game_id, agent_id, site_id, '{$this->date}' as tdate, '{$this->hour}' as thour, count(distinct concat(imei, oaid)) as install";
+
+        $where = [
+            ['activate_time', 'between', [$sTime, $eTime]],
+        ];
+        $result = Db::connect('db_game_log')->table($regTotalTb)->field($filed)->where($where)->group($this->group)->select();
+        $this->pushData($result);
+    }
+
     protected function regData()
     {
         $sTime = strtotime("{$this->date} {$this->hour}:00:00");