zxhxx před 3 roky
rodič
revize
fe9c9e600e

+ 2 - 2
application/api/controller/Donate.php

@@ -32,13 +32,13 @@ class Donate extends Api
             ],$request
         );
         if($where['full_name']=='')$this->error('姓名不能为空');
-        if(IdentityCard::isValid($where['id_card']))$this->error('身份证号不正确!');
+        if(!IdentityCard::isValid($where['id_card']))$this->error('身份证号不正确!');
         if($where['vocation']=='')$this->error('职业不能为空');
         if($where['category_ids']=='')$this->error('捐献类型不能空');
         if($where['executor_relation']=='')$this->error('执行人关系');
         if(!preg_match("/^1\d{10}$/", $where['mobile'])) $this->error('手机号不对');
         if(!preg_match("/^1\d{10}$/", $where['executor_mobile'])) $this->error('执行人移动电话不对');
-        if(IdentityCard::isValid($where['executor_id_card']))$this->error('执行人身份证号不正确!');
+        if(!IdentityCard::isValid($where['executor_id_card']))$this->error('执行人身份证号不正确!');
         $this->success(DonateModel::create($where));
     }
 

+ 1 - 1
application/api/controller/User.php

@@ -389,7 +389,7 @@ class User extends Api
         $info = UserModel::find($this->auth->getUserinfo()['id']);
         if($info['user_type']!=0 && $info['user_type']!=$where['user_type']) $this->error('用户类型不可修改');
         if(!preg_match("/^1\d{10}$/", $where['mobile'])) $this->error('手机号不对');
-        if(IdentityCard::isValid($where['id_card']))$this->error('身份证号不正确!');
+        if(!IdentityCard::isValid($where['id_card']))$this->error('身份证号不正确!');
         foreach ($where as $key=>$v)
         {
             if($v!='')