|
@@ -2474,17 +2474,16 @@ readonly class OrderService
|
|
|
];
|
|
|
|
|
|
// 6. 处理支付
|
|
|
- if ($order->payment_type === PaymentMethod::BALANCE->value) {
|
|
|
+ if ((int)$order->payment_type === PaymentMethod::BALANCE->value) {
|
|
|
$this->handleBalancePaymentForAssign($order, $userId, $coachId);
|
|
|
- } else if ($order->payment_type === PaymentMethod::WECHAT->value) {
|
|
|
+ // 7. 删除订单位置的Redis记录
|
|
|
+ Redis::zrem('order_locations', 'order_' . $order->id);
|
|
|
+ } else if ((int)$order->payment_type === PaymentMethod::WECHAT->value) {
|
|
|
// 获取微信支付配置
|
|
|
$paymentService = app(PaymentService::class);
|
|
|
$result['wx_payment'] = $paymentService->getPaymentConfig($order->id);
|
|
|
}
|
|
|
|
|
|
- // 7. 删除订单位置的Redis记录
|
|
|
- Redis::zrem('order_locations', 'order_' . $order->id);
|
|
|
-
|
|
|
// 8. 发送通知
|
|
|
$this->notifyAssignment($order, $coach);
|
|
|
|
|
@@ -2596,6 +2595,9 @@ readonly class OrderService
|
|
|
|
|
|
// 更新抢单记录
|
|
|
$this->updateGrabRecords($order->id, $coachId);
|
|
|
+
|
|
|
+ // 更新订单状态为已接单
|
|
|
+ $order->update(['state' => OrderStatus::ACCEPTED->value]);
|
|
|
});
|
|
|
}
|
|
|
|