From e5b20219644b4f6209cddaa96aeb7e619e74362d Mon Sep 17 00:00:00 2001 From: weigang Date: Mon, 28 Sep 2020 10:50:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E9=80=80=E6=AC=BE=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E8=BF=98=E8=A6=81=E9=87=8D=E6=96=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=92=8C=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/v3/OrderState.php | 7 ++++++- app/JsonRpc/OrdersService.php | 2 +- app/Service/v3/Implementations/OrderStatisticsService.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) 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')