Your Name 3 years ago
parent
commit
990dc4c806
1 changed files with 16 additions and 16 deletions
  1. 16 16
      service/agent/lib/Order.php

+ 16 - 16
service/agent/lib/Order.php

@@ -19,21 +19,7 @@ class Order
     		if (!$member) {
     			Dever::alert('代理商不存在');
     		}
-            if($member['idcard']){
-                 $birth = strlen($member['idcard'])==15 ? ('19' . substr($member['idcard'], 6, 6)) : substr($member['idcard'], 6, 8);
-                 $year=substr($birth,0,4);#出生年份
-                 $month=substr($birth,4,4);#出生日期
-                 $y=date('Y',time());#当前年份
-                 $m=date('md',time());#当前日期
-                 if(($m-$month)<0){
-                    $zhou=$y-$year-1;
-                 }else{
-                    $zhou=$y-$year;
-                 }
-                 if($zhou>=65 || $zhou<=18){
-                    Dever::alert('您不满足申请条件,请联系客服');
-                 }
-            }
+            
     		$mobile = $member['mobile'];
     		$parent_mid = $member['parent_mid'];
             $data['mid'] = $member['id'];
@@ -79,7 +65,21 @@ class Order
             $data['company_number'] = Dever::input('company_number');
             $data['source_id'] = Dever::input('source_id');
     	}
-
+        if($data['idcard']){
+             $birth = strlen($data['idcard'])==15 ? ('19' . substr($data['idcard'], 6, 6)) : substr($data['idcard'], 6, 8);
+             $year=substr($birth,0,4);#出生年份
+             $month=substr($birth,4,4);#出生日期
+             $y=date('Y',time());#当前年份
+             $m=date('md',time());#当前日期
+             if(($m-$month)<0){
+                $zhou=$y-$year-1;
+             }else{
+                $zhou=$y-$year;
+             }
+             if($zhou>=65 || $zhou<=18){
+                Dever::alert('您不满足申请条件,请联系客服');
+             }
+        }
         if ($data['source_id'] && $data['source_id'] > 0) {
             $data['invite_type'] = 2;
         } else {