|
|
@ -109,13 +109,17 @@ class Wholesaler extends Controller |
|
|
|
if (!$business) { |
|
|
|
if (!$business) { |
|
|
|
return $this->renderError('经营类目不能为空'); |
|
|
|
return $this->renderError('经营类目不能为空'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$avatar_id = intval($this->request->post('avatar_id')); |
|
|
|
|
|
|
|
if (!$avatar_id) { |
|
|
|
|
|
|
|
return $this->renderError('头像不能为空'); |
|
|
|
|
|
|
|
} |
|
|
|
// 验证短信验证码是否匹配 |
|
|
|
// 验证短信验证码是否匹配 |
|
|
|
try { |
|
|
|
try { |
|
|
|
CaptchaApi::checkSms($mobile_code, $mobile); |
|
|
|
CaptchaApi::checkSms($mobile_code, $mobile); |
|
|
|
} catch (Exception $e) { |
|
|
|
} catch (Exception $e) { |
|
|
|
return $this->renderError($e->getMessage() ?: '短信验证码不正确'); |
|
|
|
return $this->renderError($e->getMessage() ?: '短信验证码不正确'); |
|
|
|
} |
|
|
|
} |
|
|
|
$data = compact('company_name', 'credit_code', 'city_id', 'province_id', 'door_img_id', 'business', 'card_no'); |
|
|
|
$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['total_price'] = $priceInfo['price']; |
|
|
|
$data['total_price'] = $priceInfo['price']; |
|
|
|
$data['pay_price'] = $priceInfo['price']; |
|
|
|
$data['pay_price'] = $priceInfo['price']; |
|
|
@ -135,7 +139,7 @@ class Wholesaler extends Controller |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function applyInfo(): Json |
|
|
|
public function applyInfo(): Json |
|
|
|
{ |
|
|
|
{ |
|
|
|
$info = Apply::info(['cardFrontImg', 'cardBackImg', 'licenseImg', 'doorImg']); |
|
|
|
$info = Apply::info(['cardFrontImg', 'cardBackImg', 'licenseImg', 'doorImg', 'avatarImg']); |
|
|
|
if (!empty($info->cardFrontImg)) { |
|
|
|
if (!empty($info->cardFrontImg)) { |
|
|
|
unset($info->cardFrontImg); |
|
|
|
unset($info->cardFrontImg); |
|
|
|
} |
|
|
|
} |
|
|
@ -148,6 +152,9 @@ class Wholesaler extends Controller |
|
|
|
if (!empty($info->doorImg)) { |
|
|
|
if (!empty($info->doorImg)) { |
|
|
|
unset($info->doorImg); |
|
|
|
unset($info->doorImg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!empty($info->avatarImg)) { |
|
|
|
|
|
|
|
unset($info->avatarImg); |
|
|
|
|
|
|
|
} |
|
|
|
return $this->renderSuccess(compact('info')); |
|
|
|
return $this->renderSuccess(compact('info')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -211,13 +218,17 @@ class Wholesaler extends Controller |
|
|
|
if (!$business) { |
|
|
|
if (!$business) { |
|
|
|
return $this->renderError('经营类目不能为空'); |
|
|
|
return $this->renderError('经营类目不能为空'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$avatar_id = intval($this->request->post('avatar_id')); |
|
|
|
|
|
|
|
if (!$avatar_id) { |
|
|
|
|
|
|
|
return $this->renderError('头像不能为空'); |
|
|
|
|
|
|
|
} |
|
|
|
// 验证短信验证码是否匹配 |
|
|
|
// 验证短信验证码是否匹配 |
|
|
|
try { |
|
|
|
try { |
|
|
|
CaptchaApi::checkSms($mobile_code, $mobile); |
|
|
|
CaptchaApi::checkSms($mobile_code, $mobile); |
|
|
|
} catch (Exception $e) { |
|
|
|
} catch (Exception $e) { |
|
|
|
return $this->renderError($e->getMessage() ?: '短信验证码不正确'); |
|
|
|
return $this->renderError($e->getMessage() ?: '短信验证码不正确'); |
|
|
|
} |
|
|
|
} |
|
|
|
$data = compact('company_name', 'credit_code', 'city_id', 'province_id', 'door_img_id', 'business', 'card_no'); |
|
|
|
$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')); |
|
|
|
if ((new Apply())->edit($data)) { |
|
|
|
if ((new Apply())->edit($data)) { |
|
|
|
return $this->renderSuccess('操作成功'); |
|
|
|
return $this->renderSuccess('操作成功'); |
|
|
|