From d29b2dc1b1208ed7b121e2a03dc043bab0cc8499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Wed, 23 Feb 2022 16:20:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=9B=B6=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Endpoint/Api/Http/Resources/Dealer/OrderResource.php | 2 +- app/Enums/PayWay.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Endpoint/Api/Http/Resources/Dealer/OrderResource.php b/app/Endpoint/Api/Http/Resources/Dealer/OrderResource.php index 22a01316..33c9f828 100644 --- a/app/Endpoint/Api/Http/Resources/Dealer/OrderResource.php +++ b/app/Endpoint/Api/Http/Resources/Dealer/OrderResource.php @@ -21,7 +21,7 @@ class OrderResource extends JsonResource 'total_amount' => $this->total_amount, 'created_at' => $this->created_at->toDateTimeString(), 'status' => $this->status, - 'pay_way' => (string) $this->pay_way?->getDealerOrderLabel(), + 'pay_way' => (string) $this->pay_way?->label(), 'pay_info' => $this->getConsignorPayInfo(), 'pay_image'=> $this->pay_image, 'is_consignor' => $request->user()->id == $this->consignor_id, //是否发货人身份 diff --git a/app/Enums/PayWay.php b/app/Enums/PayWay.php index 9c62a073..a35bc630 100644 --- a/app/Enums/PayWay.php +++ b/app/Enums/PayWay.php @@ -24,13 +24,14 @@ enum PayWay: string { }; } - public function getDealerOrderLabel() + public function label() { return match ($this) { static::Offline => 'offline', + static::Balance => 'balance', static::Wallet => 'wallet', - static::WxpayH5 => 'wxpay', - default => 'unknown', + static::WxpayApp, static::WxpayH5, static::WxpayJs, static::WxpayMp => 'wxpay', + static::AlipayApp => 'alipay', }; }