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