From 2471bec5e10f1f5b3dc9d32cfc078eb4d6baaf75 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Sun, 28 Jun 2026 20:13:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/CouponController.php | 2 +- .../Controllers/OfflineOrderController.php | 28 ++--- .../OfflineOrderItemStatisticController.php | 48 ++++++++ app/Admin/routes.php | 1 + app/Console/Commands/OfflineOrderShip.php | 47 +++++++ app/Console/Commands/OfflineOrderSuccess.php | 56 +++++++++ .../Api/Filters/OfflineOrderFilter.php | 36 ++++++ app/Endpoint/Api/Filters/UserCouponFilter.php | 3 + .../Controllers/OfflineOrderController.php | 32 ++++- .../OfflineOrderPreviewController.php | 47 ++++++- .../Http/Controllers/UserCouponController.php | 71 ++++++++++- .../Resources/OfflineOrderItemResource.php | 26 ++++ .../Resources/OfflineOrderPreviewResource.php | 31 +++++ .../Http/Resources/OfflineOrderResource.php | 41 +++++++ .../Api/Http/Resources/UserResource.php | 16 +++ app/Endpoint/Api/routes.php | 7 ++ app/Models/Coupon.php | 10 +- app/Models/OfflineOrder.php | 16 ++- app/Models/OfflineOrderPreview.php | 17 ++- app/Models/UserCoupon.php | 21 ++++ app/Services/OfflineOrderService.php | 116 +++++++++++++++++- app/Services/PayService.php | 2 +- app/Services/WxMpService.php | 42 +++++++ resources/lang/zh_CN/offline-order.php | 1 + 24 files changed, 681 insertions(+), 36 deletions(-) create mode 100644 app/Console/Commands/OfflineOrderShip.php create mode 100644 app/Console/Commands/OfflineOrderSuccess.php create mode 100644 app/Endpoint/Api/Filters/OfflineOrderFilter.php create mode 100644 app/Endpoint/Api/Http/Resources/OfflineOrderItemResource.php create mode 100644 app/Endpoint/Api/Http/Resources/OfflineOrderPreviewResource.php create mode 100644 app/Endpoint/Api/Http/Resources/OfflineOrderResource.php create mode 100644 app/Endpoint/Api/Http/Resources/UserResource.php create mode 100644 app/Services/WxMpService.php diff --git a/app/Admin/Controllers/CouponController.php b/app/Admin/Controllers/CouponController.php index f1deac4b..888f205b 100644 --- a/app/Admin/Controllers/CouponController.php +++ b/app/Admin/Controllers/CouponController.php @@ -120,7 +120,7 @@ class CouponController extends AdminController return $this->use_end_at?->format('Y-m-d H:i:s'); }); $grid->column('is_use', '是否使用')->display(function () { - return $this->is_use ? '已使用' : '未使用'; + return $this->is_use ? $this->use_at?->format('Y-m-d H:i:s') : '未使用'; }); $grid->disableActions(); diff --git a/app/Admin/Controllers/OfflineOrderController.php b/app/Admin/Controllers/OfflineOrderController.php index 45a42905..d960e4da 100644 --- a/app/Admin/Controllers/OfflineOrderController.php +++ b/app/Admin/Controllers/OfflineOrderController.php @@ -46,29 +46,11 @@ class OfflineOrderController extends AdminController }); $grid->column('sn')->copyable(); $grid->column('user_id')->display(function () { - $nickname = $this->userInfo?->nickname ?? '---'; - $avatar = $this->userInfo?->avatar ?? 'https://via.placeholder.com/45x45.png'; - $phone = $this->user?->phone; - return <<
- {$nickname} - {$phone} - HTML; + return $this->user?->phone; }); $grid->column('store_id')->display(fn() => $this->store?->title); $grid->column('staff_id')->display(function () { - if (is_null($this->staff_id)) { - return ''; - } - - $nickname = $this->staffInfo?->nickname ?? '---'; - $avatar = $this->staffInfo?->avatar ?? 'https://via.placeholder.com/45x45.png'; - $phone = $this->staff?->phone; - return <<