From 88393fe4f2d467e5ca35920ac84db5ce4a30e544 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 28 Jul 2021 18:46:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0VerificationController?= =?UTF-8?q?=E6=A0=B8=E9=94=80=E6=8E=A7=E5=88=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api/VerificationController.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/Http/Controllers/Api/VerificationController.php diff --git a/app/Http/Controllers/Api/VerificationController.php b/app/Http/Controllers/Api/VerificationController.php new file mode 100644 index 0000000..af9092a --- /dev/null +++ b/app/Http/Controllers/Api/VerificationController.php @@ -0,0 +1,29 @@ +input('id'); //订单ID + + $user = User::firstWhere(['id' => $this->user_id, 'status' => 1]); + if (!$user || $user->verifier != 1) { + return $this->error('对不起,你没有核销权限,请联系管理员'); + } + + $order = Order::query()->find($id); + if (!in_array($order->status, [2, 3])) { + return $this->error('当前订单状态不允许核销'); + } + $order->status = 16; + $order->save(); + + return $this->success(); + } +}