Pārlūkot izejas kodu

roi 全量回传的补传

liuzejian 1 gadu atpakaļ
vecāks
revīzija
e747baaa08

+ 7 - 2
modules/Callback/Http/Controllers/CallbackLogController.php

@@ -135,7 +135,7 @@ class CallbackLogController extends CatchController
 
 
         $record = DB::table('callback_report_charge_record')
         $record = DB::table('callback_report_charge_record')
             ->where('id', $logId)
             ->where('id', $logId)
-            ->select('report_param')
+            ->select('report_param', 'filter_type')
             ->first();
             ->first();
         if(!$record || !$record->report_param) {
         if(!$record || !$record->report_param) {
             CommonBusinessException::throwError(Errors::CALLBACK_RECORD_NOT_EXISTS);
             CommonBusinessException::throwError(Errors::CALLBACK_RECORD_NOT_EXISTS);
@@ -147,7 +147,12 @@ class CallbackLogController extends CatchController
         }
         }
 
 
         $reportService = new TiktokEventReportService();
         $reportService = new TiktokEventReportService();
-        $result = $reportService->reportCharge($requestInfo);
+        if('roi_report_all' == $record->filter_type) {
+            $result = $reportService->roiReportCharge($requestInfo);
+        } else {
+            $result = $reportService->reportCharge($requestInfo);
+        }
+
         $reportSuccess = 0;
         $reportSuccess = 0;
         if($result['result']) {
         if($result['result']) {
             $resultContent = \json_decode($result['content'], true);
             $resultContent = \json_decode($result['content'], true);

+ 12 - 0
modules/Callback/Services/TiktokEventReportService.php

@@ -46,6 +46,18 @@ class TiktokEventReportService
 
 
     }
     }
 
 
+    public function roiReportCharge($user) {
+        return $this->report($this->report_url, [
+            'event_type' => $this->purchase_roi_event_type,
+            'context' => [
+                'ad' => [
+                    'callback' => $user->callback
+                ]
+            ],
+            'timestamp' => time()
+        ]);
+    }
+
     /**
     /**
      * 付费上报
      * 付费上报
      */
      */