From 83ef737b03e2157eb2cec6bd064fbc4f965fe3bc Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 21 Dec 2023 14:36:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E8=B4=A6=E5=8F=B7=E7=BB=91=E5=AE=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E9=93=B6=E8=A1=8C=E5=8D=A1=E6=8C=81?= =?UTF-8?q?=E6=9C=89=E4=BA=BA=E5=B9=B4=E9=BE=84=E5=8F=AA=E8=83=BD=E5=9C=A8?= =?UTF-8?q?18~60=E5=B2=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/use-staff/src/api/IndexController.php | 14 ++++++++++++++ plugins/use-staff/src/models/ExternalApi.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/use-staff/src/api/IndexController.php b/plugins/use-staff/src/api/IndexController.php index 1b1f9831..ca81792c 100644 --- a/plugins/use-staff/src/api/IndexController.php +++ b/plugins/use-staff/src/api/IndexController.php @@ -32,6 +32,20 @@ class IndexController extends ApiController{ $info = request()->input('info'); $info['uid'] = \YunShop::app()->getMemberId(); 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); (new ExternalApi())->personnelResult($applyResult['memberId'],$applyResult['transSeqId']); diff --git a/plugins/use-staff/src/models/ExternalApi.php b/plugins/use-staff/src/models/ExternalApi.php index f7844c0e..e1d86354 100644 --- a/plugins/use-staff/src/models/ExternalApi.php +++ b/plugins/use-staff/src/models/ExternalApi.php @@ -164,7 +164,7 @@ class ExternalApi extends BaseModel{ $params['uid'] = $info['uid']; $params['memberId'] = $result['memberId']; $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'); if($isHas > 0) (new UseStaff())->updateRecord($params);