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