78 lines
1.9 KiB
PHP
78 lines
1.9 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
use app\common\pay\SignContract;
|
|
use think\Db;
|
|
|
|
class Yun extends Common
|
|
{
|
|
//获取云账户签约状态
|
|
public function get_sign_status()
|
|
{
|
|
$user_info = Db::name('user')->find($this->uid);
|
|
if (empty($user_info)) ajaxReturn(201, '用户信息不存在');
|
|
// $real_name = $user_info['bank_user_name'];
|
|
$real_name = $user_info['real_name'];
|
|
$id_card = $user_info['card_id'];
|
|
|
|
|
|
if (empty($real_name) || empty($id_card)) {
|
|
ajaxReturn(201, '请先实名认证');
|
|
}
|
|
$result = SignContract::getSignStatus($real_name, $id_card);
|
|
|
|
|
|
ajaxReturn(...$result);
|
|
}
|
|
//获取签约url
|
|
public function get_sign_contract_url()
|
|
{
|
|
$result = SignContract::getSignContractUrl();
|
|
ajaxReturn(...$result);
|
|
}
|
|
//签约提交
|
|
public function submit_sign()
|
|
{
|
|
|
|
$card_type = 'idcard';
|
|
|
|
$user_info = Db::name('user')->find($this->uid);
|
|
if (empty($user_info)) ajaxReturn(201, '用户信息不存在');
|
|
|
|
$real_name = $user_info['real_name'];
|
|
$id_card = $user_info['card_id'];
|
|
$phone = $user_info['user_name'];
|
|
|
|
|
|
if (empty($real_name) || empty($id_card) || empty($card_type)) {
|
|
ajaxReturn(201, '请先实名认证!');
|
|
}
|
|
if (!in_array($card_type, array_column(SignContract::$cart_type, 'id'))) {
|
|
ajaxReturn(201, '证件类型错误');
|
|
}
|
|
|
|
// halt([
|
|
// $real_name,
|
|
// $id_card,
|
|
// $phone
|
|
|
|
// ]);
|
|
$result = SignContract::submitSign($real_name, $id_card, $card_type, $phone);
|
|
ajaxReturn(...$result);
|
|
}
|
|
//身份类型
|
|
public function get_card_type_yun()
|
|
{
|
|
ajaxReturn(200, '获取数据成功', SignContract::$cart_type);
|
|
}
|
|
|
|
//解约
|
|
public function release()
|
|
{
|
|
|
|
}
|
|
|
|
} |