From 6623cc1d2e0ed7922d3c4d6795312c614d5224b4 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Fri, 19 Jul 2024 10:23:37 +0800 Subject: [PATCH] 1 --- app/api/controller/Wholesaler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Wholesaler.php b/app/api/controller/Wholesaler.php index 498b124a..2252fcf3 100644 --- a/app/api/controller/Wholesaler.php +++ b/app/api/controller/Wholesaler.php @@ -231,9 +231,12 @@ class Wholesaler extends Controller return $this->renderError('头像不能为空'); } $info = Apply::info(); - if (empty($info->id)) { + if (empty($info->id) || empty($info->status)) { return $this->renderError('信息不存在'); } + if ($info->status == WholesalerEnum::ADOPT) { + return $this->renderError('申请已通过'); + } $model = new Apply(); $exists_id = $model->where(['card_no' => $card_no])->value('id'); if ($exists_id && $info->id != $exists_id) { @@ -251,7 +254,7 @@ class Wholesaler extends Controller $data = compact('company_name', 'credit_code', 'city_id', 'province_id', 'door_img_id', 'business', 'card_no', 'avatar_id'); $data = array_merge($data, compact('username', 'mobile', 'card_back_img_id', 'card_front_img_id', 'license_img_id')); $data['status'] = WholesalerEnum::AUDITING; - if ((new Apply())->where()->edit($data)) { + if ((new Apply())->edit($data)) { return $this->renderSuccess('操作成功'); } return $this->renderError('操作失败');