添加:第三方账号绑定添加判断,银行卡持有人年龄只能在18~60岁
This commit is contained in:
parent
e5c68398b3
commit
83ef737b03
|
|
@ -32,6 +32,20 @@ class IndexController extends ApiController{
|
||||||
$info = request()->input('info');
|
$info = request()->input('info');
|
||||||
$info['uid'] = \YunShop::app()->getMemberId();
|
$info['uid'] = \YunShop::app()->getMemberId();
|
||||||
try{
|
try{
|
||||||
|
// 判断:银行卡是否已经存在
|
||||||
|
$isHas = (int)UseStaff::uniacid()
|
||||||
|
->where('card_num',$info['card_num'])
|
||||||
|
->where('uid','<>',$info['uid'])
|
||||||
|
->value('id');
|
||||||
|
if($isHas > 0) throw new \Exception('当前银行卡已被绑定,请更换银行卡!');
|
||||||
|
// 判断:年龄是否允许 已满18岁,未满60岁
|
||||||
|
$accountId = $info['account_id'];
|
||||||
|
$birthday = strtotime(substr($accountId, 6, 8));// 出生日期时间戳
|
||||||
|
$yearsOld18 = strtotime("+18 year",$birthday);
|
||||||
|
$yearsOld60 = strtotime("+60 year",$birthday);
|
||||||
|
$time = time();
|
||||||
|
if($time < $yearsOld18 || $time > $yearsOld60) throw new \Exception('银行卡持有人年龄必须在18~60岁');
|
||||||
|
// 入户
|
||||||
$applyResult = (new ExternalApi())->personnelAccess($info);
|
$applyResult = (new ExternalApi())->personnelAccess($info);
|
||||||
(new ExternalApi())->personnelResult($applyResult['memberId'],$applyResult['transSeqId']);
|
(new ExternalApi())->personnelResult($applyResult['memberId'],$applyResult['transSeqId']);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ class ExternalApi extends BaseModel{
|
||||||
$params['uid'] = $info['uid'];
|
$params['uid'] = $info['uid'];
|
||||||
$params['memberId'] = $result['memberId'];
|
$params['memberId'] = $result['memberId'];
|
||||||
$params['trans_seq_id'] = $result['transSeqId'];
|
$params['trans_seq_id'] = $result['transSeqId'];
|
||||||
$params['status'] = $result['state'];
|
$params['status'] = $result['state'] ?? 0;
|
||||||
// 判断:当前用户是否已经存在账号信息
|
// 判断:当前用户是否已经存在账号信息
|
||||||
$isHas = (int)UseStaff::uniacid()->where('uid',$info['uid'])->value('id');
|
$isHas = (int)UseStaff::uniacid()->where('uid',$info['uid'])->value('id');
|
||||||
if($isHas > 0) (new UseStaff())->updateRecord($params);
|
if($isHas > 0) (new UseStaff())->updateRecord($params);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue