Your Name 2 年之前
父节点
当前提交
de70475c01
共有 3 个文件被更改,包括 45 次插入0 次删除
  1. 15 0
      service/agent/lib/Order.php
  2. 10 0
      service/option/database/account.php
  3. 20 0
      service/option/src/My.php

+ 15 - 0
service/agent/lib/Order.php

@@ -107,6 +107,21 @@ class Order
         $idcard_path = Dever::input('idcard_path');
         if($idcard_path){
             $data['idcard_path'] = $idcard_path;
+            $idcard_path = (array)json_decode($data['idcard_path']);
+            if($idcard_path['face']){
+                $rest = (array)$idcard_path['face'];
+                if($data['name'] != $rest['name'] || $data['idcard'] != $rest['idNumber']){
+                    Dever::alert('姓名或身份证号不匹配');
+                }
+            }
+            if($idcard_path['back']){
+                $rest = (array)$idcard_path['back'];
+                $date = explode('-',$rest['validPeriod']);
+                $cdate = strtotime(str_replace('.','-',$date[1]));
+                if(time()>=$cdate){
+                    Dever::alert('身份证背面已过期');
+                }
+            }
         }
         if ($data['source_id'] && $data['source_id'] > 0) {
             $data['invite_type'] = 2;

+ 10 - 0
service/option/database/account.php

@@ -273,6 +273,16 @@ return array
             'list_order' => 6,
         ),
 
+        'idcard_path'      => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '身份证信息',
+            'default'   => '',
+            'desc'      => '身份证信息',
+            'match'     => 'is_string',
+            'update'    => 'text',
+        ),
+
         'audit'        => array
         (
             'type'      => 'tinyint-1',

+ 20 - 0
service/option/src/My.php

@@ -222,6 +222,26 @@ class My extends Core
             Dever::alert('请上传身份证背面照片');
         }
 
+        $where['idcard_path'] = Dever::input('idcard_path');
+        if($where['idcard_path']){
+            $data['idcard_path'] = $where['idcard_path'];
+            $idcard_path = (array)json_decode($data['idcard_path']);
+            if($idcard_path['face']){
+                $rest = (array)$idcard_path['face'];
+                if($this->user['name'] != $rest['name'] || $this->user['idcard'] != $rest['idNumber']){
+                    Dever::alert('姓名或身份证号不匹配');
+                }
+            }
+            if($idcard_path['back']){
+                $rest = (array)$idcard_path['back'];
+                $date = explode('-',$rest['validPeriod']);
+                $cdate = strtotime(str_replace('.','-',$date[1]));
+                if(time()>=$cdate){
+                    Dever::alert('身份证背面已过期');
+                }
+            }
+        }
+
         $where['email'] = Dever::input('email');
         if (!$where['email']) {
             Dever::alert('请填写邮箱');