* [ * 'uid' => '1', * 'orderId' => 1 * 'ranseId' => 1, * ] * */ private $info; /** * Create a new job instance. */ public function __construct($info) { $this->info = $info; } /** * Execute the job. */ public function handle(): void { $traceContext = TraceContext::newFromParent($this->info['traceInfo']); myLog('reportCharge')->info('开始处理订单回传', [ 'orderInfo' => $this->info, 'traceInfo' => $traceContext->getTraceInfo() ]); $order = DB::table('orders')->where('id', $this->info['orderId'])->first(); if($order && $order->promotion_id) { $promotion = DB::table('promotions')->where([ 'id'=> $order->promotion_id, 'is_enabled' => 1 ])->first(); switch ($promotion->callback_type ?? 0) { case 0: myLog('reportCharge')->error('end:订单染色配置有问题', [ 'traceInfo' => $traceContext->getTraceInfo() ]); break; case 1: //巨量账户级别回传 $reportService = new JuliangAccountReportChargeService($this->info['uid'], $order, $this->info['traceInfo']); $reportService->report(); break; case 2: //巨量2.0事件回传 $reportService = new JLEventReportChargeService($this->info['uid'], $order, $this->info['traceInfo']); $reportService->report(); break; } } else { myLog('reportCharge')->error('end:订单不存在或订单没有推广信息', [ 'traceInfo' => $traceContext->getTraceInfo() ]); } } }