orderId = $orderId; $this->queue = config('queue.names.handle_order_pay_success'); } public function handle() { $order = Order::where('pay_state', PayState::SUCCESS) ->where('lottery_state', LottState::PENDING) ->find($this->orderId); if (!$order) { Log::error('HandleOrderPaySuccess not found order ', [ 'order_id' => $this->orderId ]); return ; } if ($order->pay_state != PayState::SUCCESS) { Log::error('HandleOrderPaySuccess order pay_state error ', [ 'order_id' => $this->orderId, 'pay_state' => $order->pay_state, ]); return ; } if ($order->lottery_state != LottState::PENDING) { Log::error('HandleOrderPaySuccess order lottery_state error ', [ 'order_id' => $this->orderId, 'lottery_state' => $order->lottery_state, ]); return ; } Log::info('HandleOrderPaySuccess orderId:'. $this->orderId); /** @var WechatService $wechatService */ $wechatService = app(WechatService::class); $wechatService->sendTemplateMessage($order); } }