pull/5/head
wanghousheng 4 months ago
parent b2ba7daabc
commit 4c9d0732f3
  1. 4
      app/api/controller/Wholesaler.php
  2. 4
      app/store/model/dealer/User.php

@ -120,10 +120,10 @@ class Wholesaler extends Controller
return $this->renderError($e->getMessage() ?: '短信验证码不正确');
}
$model = new Apply();
if ($model->where(['card_no' => $card_no])->exists()) {
if ($model->where(['card_no' => $card_no])->value('id')) {
return $this->renderError('该身份证号已存在');
}
if ($model->where(['credit_code' => $credit_code])->exists()) {
if ($model->where(['credit_code' => $credit_code])->value('id')) {
return $this->renderError('营业执照已存在');
}
$data = compact('company_name', 'credit_code', 'city_id', 'province_id', 'door_img_id', 'business', 'card_no', 'avatar_id');

@ -12,6 +12,7 @@ declare (strict_types=1);
namespace app\store\model\dealer;
use app\common\enum\user\UserTypeEnum;
use app\common\model\dealer\User as UserModel;
use app\store\model\dealer\Apply as ApplyModel;
use app\store\model\dealer\Referee as RefereeModel;
@ -89,6 +90,9 @@ class User extends UserModel
// 删除申请记录
$applyModel = new ApplyModel();
$applyModel->where(['user_id' => $this['user_id']])->delete();
//修改会员身份
$userModel = new \app\common\model\User();
$userModel->where(['user_id' => $this['user_id']])->save(['user_type' => UserTypeEnum::NORMAL, 'fx_effective_time' => null]);
$this->onDeleteReferee($this['user_id']);
// 标记当前分销商记录为已删除
return $this->delete();

Loading…
Cancel
Save