From 89babdfa7278ed48dc965b0fe642fde0c4f76dd5 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 1 Sep 2021 16:23:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E9=94=80=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/VerificationController.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Api/VerificationController.php b/app/Http/Controllers/Api/VerificationController.php index ecc2f8e..fcbea2c 100644 --- a/app/Http/Controllers/Api/VerificationController.php +++ b/app/Http/Controllers/Api/VerificationController.php @@ -31,13 +31,9 @@ class VerificationController extends Controller return $this->error('订单不存在或订单状态不允许核销'); } - $user = User::firstWhere(['id' => $this->user_id, 'status' => 1]); - if (!$user || $user->is_verify !=1) { - return $this->error('对不起,你没有核销权限,请联系管理员'); - } - - $checkMobile = Product::query()->whereIn('id',explode(',',$order->product_ids))->where('verify_mobile',$user->mobile)->doesntExist(); + $mobile = User::where('id', $this->user_id)->value('mobile'); + $checkMobile = Product::query()->whereIn('id', explode(',', $order->product_ids))->where('verify_mobile', $mobile)->doesntExist(); if ($checkMobile) { return $this->error('对不起,你没有核销权限,请联系管理员'); }