orderId = $orderId; $this->queue = config('queue.names.compute_customer_level'); } // 1、普通:累加方案金额和2倍中奖 // 1、合买:累加方案金额和2倍中奖;参与人只累加购买 // 1、发单:累加方案金额和2倍中奖;跟单人累加购买和中 public function handle() { Log::info('ComputeCustomerWinLevelScore, orderId:'. $this->orderId); $order = Order::find( $this->orderId); if (!$order) { return; } if ($order->lottery_prize <= 0) { Log::error('CustomerWinAddLevelListener 订单没有中奖', [ 'order' => $order->toArray() ]); return; } if ($order->type == OrderType::GENDAN) { Customer::levelScoreIncr($order->customer_id, $order->lottery_prize); return; } if ($order->type == OrderType::UNION) { if ($order->id != $order->pid) { return; } $money = ($order->lottery_prize / $order->union_piece_total) * ($order->union_piece_self +$order->union_piece_keep); Customer::levelScoreIncr($order->customer_id, $money * 2); return; } Customer::levelScoreIncr($order->customer_id,2*$order->lottery_prize); } }