From 7a7f690e6e0ac231955b0760a1cbfefdcf06bcdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=80=E6=9C=AF=E8=80=81=E8=83=A1?= <1094551889@qq.com> Date: Thu, 29 Aug 2024 15:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/PayController.php | 3 +++ public/order.php | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controller/PayController.php b/app/controller/PayController.php index 8f0f6ef..42081b3 100644 --- a/app/controller/PayController.php +++ b/app/controller/PayController.php @@ -218,6 +218,9 @@ class PayController $path = '../runtime/order.json'; if ($is_user) { $orders = Order::scope('activeOrder')->field('id,pid,aid,cid')->select(); + if (!file_exists($path)) { + file_put_contents($path, '[]'); + } $old_info = file_get_contents($path); $num = count($orders); if ($num > 0) { diff --git a/public/order.php b/public/order.php index 6c9ebe7..69432bd 100644 --- a/public/order.php +++ b/public/order.php @@ -1,4 +1,9 @@