From 73cea886e622a56ea34768a0620ed17e0b4d4084 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Sat, 25 Feb 2023 17:55:13 +0800 Subject: [PATCH] 1 --- app/Admin/Controllers/Store/OrderController.php | 4 +++- app/Listeners/OrderPrint.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Admin/Controllers/Store/OrderController.php b/app/Admin/Controllers/Store/OrderController.php index 7b2e9cc9..c42e0aef 100644 --- a/app/Admin/Controllers/Store/OrderController.php +++ b/app/Admin/Controllers/Store/OrderController.php @@ -194,9 +194,11 @@ class OrderController extends AdminController $show->field('pay_at'); $show->field('completed_at'); - $show->panel()->tools(function ($tools) { + $show->panel()->tools(function (Show\Tools $tools) { $tools->disableEdit(); $tools->disableDelete(); + + $tools->append(new \App\Admin\Actions\Store\ShowOrderPrint()); }); $row = new Row(); diff --git a/app/Listeners/OrderPrint.php b/app/Listeners/OrderPrint.php index d225b829..00d09d7a 100644 --- a/app/Listeners/OrderPrint.php +++ b/app/Listeners/OrderPrint.php @@ -40,7 +40,7 @@ class OrderPrint 'sn' => $order->sn, 'time' => $order->created_at->format('Y-m-d H:i:s'), 'desk' => $desk->name, - 'products' => json_encode($products, JSON_UNESCAPED_UNICODE), + 'products' => $products, 'total' => round($order->total_amount, 2, PHP_ROUND_HALF_DOWN), 'remarks' => $order->note ?: '', ];