|
|
@ -231,9 +231,12 @@ class Wholesaler extends Controller |
|
|
|
return $this->renderError('头像不能为空'); |
|
|
|
return $this->renderError('头像不能为空'); |
|
|
|
} |
|
|
|
} |
|
|
|
$info = Apply::info(); |
|
|
|
$info = Apply::info(); |
|
|
|
if (empty($info->id)) { |
|
|
|
if (empty($info->id) || empty($info->status)) { |
|
|
|
return $this->renderError('信息不存在'); |
|
|
|
return $this->renderError('信息不存在'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($info->status == WholesalerEnum::ADOPT) { |
|
|
|
|
|
|
|
return $this->renderError('申请已通过'); |
|
|
|
|
|
|
|
} |
|
|
|
$model = new Apply(); |
|
|
|
$model = new Apply(); |
|
|
|
$exists_id = $model->where(['card_no' => $card_no])->value('id'); |
|
|
|
$exists_id = $model->where(['card_no' => $card_no])->value('id'); |
|
|
|
if ($exists_id && $info->id != $exists_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 = 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 = array_merge($data, compact('username', 'mobile', 'card_back_img_id', 'card_front_img_id', 'license_img_id')); |
|
|
|
$data['status'] = WholesalerEnum::AUDITING; |
|
|
|
$data['status'] = WholesalerEnum::AUDITING; |
|
|
|
if ((new Apply())->where()->edit($data)) { |
|
|
|
if ((new Apply())->edit($data)) { |
|
|
|
return $this->renderSuccess('操作成功'); |
|
|
|
return $this->renderSuccess('操作成功'); |
|
|
|
} |
|
|
|
} |
|
|
|
return $this->renderError('操作失败'); |
|
|
|
return $this->renderError('操作失败'); |
|
|
|