diff --git a/app/Constants/v3/OrderState.php b/app/Constants/v3/OrderState.php index af1ff7c..fb7cfb5 100644 --- a/app/Constants/v3/OrderState.php +++ b/app/Constants/v3/OrderState.php @@ -60,6 +60,11 @@ class OrderState extends AbstractConstants */ const REFUND_REFUSE = 10; + /** + * @Message("部分直接退款") + */ + const REFUNDED_DIRECT= 11; + /** * @Message("待送达") */ @@ -73,7 +78,7 @@ class OrderState extends AbstractConstants /** * @Message("售后/退款") */ - const REFUND = [self::REFUNDING, self::REFUNDED, self::REFUND_REFUSE]; + const REFUND = [self::REFUNDING, self::REFUNDED, self::REFUND_REFUSE, self::REFUNDED_DIRECT]; /** * @Message("可删除") diff --git a/app/JsonRpc/OrdersService.php b/app/JsonRpc/OrdersService.php index ef24441..81ac54b 100644 --- a/app/JsonRpc/OrdersService.php +++ b/app/JsonRpc/OrdersService.php @@ -274,7 +274,7 @@ class OrdersService implements OrdersServiceInterface $currentTime = time(); // 处理订单状态 - $orderMain->state = OrderState::REFUNDED; + $orderMain->state = OrderState::REFUNDED_DIRECT; $orderMain->total_refund_note = $note; $orderMain->refund_time = $currentTime; $orderMain->save(); diff --git a/app/Service/v3/Implementations/OrderStatisticsService.php b/app/Service/v3/Implementations/OrderStatisticsService.php index e235e9e..3c7e88b 100644 --- a/app/Service/v3/Implementations/OrderStatisticsService.php +++ b/app/Service/v3/Implementations/OrderStatisticsService.php @@ -38,7 +38,7 @@ class OrderStatisticsService implements OrderStatisticsServiceInterface ->selectRaw('COUNT(DISTINCT '.$mainTable.'.id) AS count') ->join($childTable, ''.$childTable.'.order_main_id', '=', ''.$mainTable.'.global_order_id') ->where([''.$childTable.'.store_id' => $storeId, ''.$mainTable.'.type' => $type]) - ->whereIn(''.$mainTable.'.state', array_merge(OrderState::FINISH, [OrderState::REFUNDED,OrderState::REFUND_REFUSE])); + ->whereIn(''.$mainTable.'.state', array_merge(OrderState::FINISH, [OrderState::REFUNDED_DIRECT,OrderState::REFUND_REFUSE])); if ($type == OrderType::ONLINE) { $builder = $builder->join($goodsTable, ''.$goodsTable.'.order_id', '=', ''.$childTable.'.id')