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(); + } +}