diff --git a/application/api/model/UserData.php b/application/api/model/UserData.php index 99bc3294..f71ff811 100644 --- a/application/api/model/UserData.php +++ b/application/api/model/UserData.php @@ -255,6 +255,10 @@ class UserData extends Model return ['code' => 0, 'msg' => '登录失效,请重新登录','data' =>null]; } + $old_password = db::name('user')->where('id' , $user_id)->value('password'); + if ($old_password == md5($password)) { + return ['code' => 0, 'msg' => '修改失败了!','data' =>null]; + } $reslut = db::name('user')->where('id' , $user_id)->update(['password' => md5($password)]); if ($reslut) { @@ -312,18 +316,29 @@ class UserData extends Model //查询是否已经提交过数据了 $is_real = db::name('user_auth')->where(['card_id' => $id_card,'mobile' =>$user_mobile])->find(); if($is_real){ - return ['code' => 0, 'msg' => '已经审核通过!请勿重复提交!','data' =>null]; + if($is_real['is_real'] == 1){ + return ['code' => 0, 'msg' => '已经审核通过!请勿重复提交!','data' =>null]; + }else{ + $auth = [ + 'mobile' => $user_mobile, + 'real_name' => $real_name, + 'card_id' => $id_card, + 'is_real' => 3, + 'updatetime' => time(), + ]; + db::name('user_auth')->where(['id' => $is_real['id']])->update($auth); + } + }else{ + $auth = [ + 'mobile' => $user_mobile, + 'real_name' => $real_name, + 'card_id' => $id_card, + 'is_real' => 3, + 'createtime' => time(), + ]; + db::name('user_auth')->insert($auth); } - $auth = [ - 'mobile' => $user_mobile, - 'real_name' => $real_name, - 'card_id' => $id_card, - 'is_real' => 3, - 'createtime' => time(), - ]; - db::name('user_auth')->insert($auth); - $config = get_system_config(); //获取Access Token $access_token = $this->redis->get('access_token_'.$config['tencent_app_id']);