|
@@ -190,6 +190,7 @@ class OrderService
|
|
|
*/
|
|
|
private function getNearbyOrders($location, float $maxDistance = 40): array
|
|
|
{
|
|
|
+
|
|
|
$nearbyOrders = Redis::georadius(
|
|
|
'order_locations',
|
|
|
$location->longitude,
|
|
@@ -603,8 +604,12 @@ class OrderService
|
|
|
|
|
|
abort_if($order->coach_id !== $user->coach->id, 403, '无权操作此订单');
|
|
|
|
|
|
-
|
|
|
- abort_if($order->state != OrderStatus::ASSIGNED->value && $order->state != OrderStatus::ACCEPTED->value, 400, '订单状态不正确');
|
|
|
+
|
|
|
+ if ($order->type == OrderType::VISIT->value) {
|
|
|
+ abort_if($order->state != OrderStatus::ACCEPTED->value, 400, '订单状态不正确');
|
|
|
+ } elseif ($order->type == OrderType::GRAB->value) {
|
|
|
+ abort_if($order->state != OrderStatus::PAID->value, 400, '订单状态不正确');
|
|
|
+ }
|
|
|
|
|
|
|
|
|
$order->state = OrderStatus::DEPARTED->value;
|