浏览代码

uchc qapp

zhoulj 4 年之前
父节点
当前提交
e8cfcb911c

+ 2 - 0
src/Services/LandingPage/LandingPageLinkService.php

@@ -66,6 +66,7 @@ class LandingPageLinkService
     const tiktok = 'tiktok';
     const iqiyi = 'iqiyi';
     const uc = 'uc';
+    const uchc = 'uchc';
     const weibo = 'weibo';
     const tencent = 'tencent';
     const kuaishou = 'kuaishou';
@@ -76,6 +77,7 @@ class LandingPageLinkService
         self::tiktok,
         self::iqiyi,
         self::uc,
+        self::uchc,
         self::weibo,
         self::tencent,
         self::kuaishou,

+ 2 - 0
src/Services/Report/BaseReport.php

@@ -61,6 +61,8 @@ abstract class BaseReport implements ReportInterface
             } else {
                 $result = false;
             }
+            myLog('report')->info('report_param:'.json_encode($query_params).' response:'.json_encode($response).' url:'.$url);
+            
         } catch (Exception $e) {
             myLog('report')->error($url);
             myLog('report')->error($e->getMessage());

+ 41 - 0
src/Services/Report/QappUchcReport.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace General\Services\Report;
+
+use General\Models\Report\ReportUserBindRecord;
+
+/**
+ * uc数据上报
+ */
+class QappUchcReport extends BaseReport
+{
+    public function __construct()
+    {
+        $this->charge_event_type = 69;
+        $this->register_event_type = 67;
+        $this->report_url = '';// 同callback参数
+    }
+
+
+    public function getRegisterQueryParams(ReportUserBindRecord $user): array
+    {
+        return  [
+            'callback' => $user->callback,
+            'type' => $this->register_event_type,
+            'event_time' => time() * 100,
+            'source' => $user->source,
+            'money' => 0,
+        ];
+    }
+
+    public function getChargeQueryParams(ReportUserBindRecord $user, float $amount): array
+    {
+        return  [
+            'callback' => $user->callback,
+            'type' => $this->charge_event_type,
+            'event_time' => time() * 100,
+            'source' => $user->source,
+            'money' => $amount,
+        ];
+    }
+}