liuzejian 1 rok pred
rodič
commit
c09aad5be7

+ 23 - 5
app/Service/Callback/JuliangAccountReportChargeService.php

@@ -49,8 +49,6 @@ class JuliangAccountReportChargeService
     }
 
     private function saveRecord() {
-        dump($this->result);
-
         if($this->result['save_record'] ?? true) {
             $now = date('Y-m-d H:i:s');
             if(($this->result['info_type'] ?? '') == 'promotion_protect') {
@@ -153,6 +151,9 @@ class JuliangAccountReportChargeService
         }
     }
 
+    /**
+     * 判断回传比例
+     */
     private function judgeCallbackRate(){
         if(!$this->result['need_report']) {
             return;
@@ -195,11 +196,14 @@ class JuliangAccountReportChargeService
         }
     }
 
+    /**
+     * 判断计划是否在保护
+     */
     private function judgePromotionProtect() {
         if(!$this->result['need_report']) {
             return;
         }
-        if(0 == $this->callbackConfig->protect_num) {
+        if($this->callbackConfig->protect_num <= 0) {
             $this->result['need_report'] = true;
         } else {
             $advPromotionId = $this->trackRecord->adv_promotion_id;
@@ -216,7 +220,9 @@ class JuliangAccountReportChargeService
         }
     }
 
-
+    /**
+     * 判断订单是不是已经处理过了.如果处理过了,就不入库
+     */
     private function judgeOrderAlreadyDeal() {
         if(!$this->result['need_report']) {
             return;
@@ -231,6 +237,9 @@ class JuliangAccountReportChargeService
         }
     }
 
+    /**
+     * 判断充值的金额区间
+     */
     private function judgeChargeMoney() {
         if(!$this->result['need_report']) {
             return;
@@ -246,7 +255,9 @@ class JuliangAccountReportChargeService
         }
     }
 
-
+    /**
+     * 判断是否是首充,只有首充回传
+     */
     private function judgeIsFirstCharge() {
         if(!$this->result['need_report']) {
             return;
@@ -269,6 +280,9 @@ class JuliangAccountReportChargeService
         }
     }
 
+    /**
+     * 获取订单的染色信息,回传配置信息
+     */
     private function fillRanseInfo() {
         $ranseId = $this->order->promotion_id;
         $this->promotion = DB::table('promotions')->where('id', $ranseId)->first();
@@ -318,6 +332,10 @@ class JuliangAccountReportChargeService
         $this->result['report_result'] = $reportResult;
         $this->result['need_report'] = false;
     }
+
+    /**
+     * 获取匹配的广告用户信息,主要是获取回传 callback
+     */
     private function fillTrackInfo() {
         if(!$this->result['need_report']) {
             return;