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('对不起,你没有核销权限,请联系管理员'); }