orderId,'产品订单分账结算队列start'); $this->setRequest(); //支付后立即结算 $ProductOrder = ProductOrder::findOne([ 'id' => $this->orderId, 'is_pay' => 1, 'is_settled' => 0 ]); if (!$ProductOrder || $ProductOrder->type != 2) { throw new \Exception('订单不存在'); } $ledgerForm = new LedgerForm(); $ledgerForm->order_id = $this->orderId; $ledgerForm->status = 1; // 已结算 $ledgerForm->update(); ProductOrderLog::saveLog($this->orderId,'产品订单分账结算队列end'); } catch (\Exception $exception) { ProductOrderLog::saveLog($this->orderId,'产品订单分账结算队列异常:'.$exception->getMessage().'------'.$exception->getLine()); return; } } }