Forráskód Böngészése

兼容推广被禁用的情况

liuzejian 1 éve
szülő
commit
b18c6fc0b1

+ 4 - 1
app/Jobs/Callback/ReportCharge.php

@@ -48,7 +48,10 @@ class ReportCharge implements ShouldQueue
 
         $order = DB::table('orders')->where('id', $this->info['orderId'])->first();
         if($order && $order->promotion_id) {
-            $promotion = DB::table('promotions')->where('id', $order->promotion_id)->first();
+            $promotion = DB::table('promotions')->where([
+                'id'=> $order->promotion_id,
+                'is_enabled' => 1
+            ])->first();
             switch ($promotion->callback_type ?? 0) {
                 case 0:
                     myLog('reportCharge')->error('end:订单染色配置有问题', [

+ 7 - 1
app/Service/Callback/JuliangAccountReportChargeService.php

@@ -289,11 +289,17 @@ class JuliangAccountReportChargeService
     }
 
     /**
-     * 获取订单的染色信息,回传配置信息
+     * 获取订单的染色信息,回传配置信息, 推广被禁用,就按照没有回传配置处理
      */
     private function fillRanseInfo() {
         $ranseId = $this->order->promotion_id;
         $this->promotion = DB::table('promotions')->where('id', $ranseId)->first();
+        if(0 == $this->promotion->status) {
+            $this->result['need_report'] = false;
+            $this->result['info_type'] = 'no_callback_config';
+            $this->result['info_str'] = '没有回传配置';
+            return;
+        }
         $this->callbackConfig = DB::table('juliang_account_callback_config')
             ->where(['id' => $this->promotion->callback_config_id])
             ->first();