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