plsId = $plsId; $this->queue = config('queue.names.refresh_order_odds'); } public function getData() { return [ '$plsId' => $this->plsId ]; } public function handle() { Log::info('RefreshOrderPlsResult::start, plsId:' . $this->plsId); $lotteryType = LotteryType::where('type', LottType::PLS)->first(); if (!$lotteryType) { Log::error('RefreshOrderPlsResult 无排列三彩种'); return; } $pls = Pls::find($this->plsId); if (!$pls) { Log::error('RefreshOrderPlsResult plsId not found:' . $this->plsId); return; } if ($pls->state != BoolEnum::YES) { Log::error('RefreshOrderPlsResult plsId not publish result:' . $this->plsId); return; } Order::where('lottery_type_id', $lotteryType->id) ->where('issue_num', $pls->issue_num) ->where('pay_state', PayState::SUCCESS) ->where('lottery_state', LottState::WAIT) ->chunkById(500, function($orders) use ($pls) { foreach ($orders as $order) { $this->dispatchComputeOrderPrize($order->id); } }); } private function dispatchComputeOrderPrize($orderId) { Log::info('dispatch ComputePlsOrderPrize, orderId:'.$orderId); ComputePlsOrderPrize::dispatch($orderId); } }