实名处理
This commit is contained in:
@@ -287,11 +287,16 @@ class UserData extends Model
|
|||||||
if(empty($user_mobile)){
|
if(empty($user_mobile)){
|
||||||
return ['code' => 0, 'msg' => '请先绑定手机号','data' =>null];
|
return ['code' => 0, 'msg' => '请先绑定手机号','data' =>null];
|
||||||
}
|
}
|
||||||
//查询是否已经提交过数据了
|
$card_id_count = db::name('user_auth')->where(['card_id' => $id_card,'is_real' => 1])->count();
|
||||||
$is_real = db::name('user_auth')->where(['card_id' => $id_card,'is_real' => 1])->find();
|
if($card_id_count >= 3){
|
||||||
if($is_real){
|
return ['code' => 0, 'msg' => '该身份证实名已达上限!','data' =>null];
|
||||||
return ['code' => 0, 'msg' => '已经提交审核了,请等待验证结果!','data' =>null];
|
|
||||||
}
|
}
|
||||||
|
//查询是否已经提交过数据了
|
||||||
|
$is_real = db::name('user_auth')->where(['card_id' => $id_card,'is_real' => 1,'mobile' =>$user_mobile])->find();
|
||||||
|
if($is_real){
|
||||||
|
return ['code' => 0, 'msg' => '已经审核通过!请勿重复提交!','data' =>null];
|
||||||
|
}
|
||||||
|
|
||||||
$auth = [
|
$auth = [
|
||||||
'mobile' => $user_mobile,
|
'mobile' => $user_mobile,
|
||||||
'real_name' => $real_name,
|
'real_name' => $real_name,
|
||||||
@@ -347,8 +352,17 @@ class UserData extends Model
|
|||||||
public function real_name_result($user_id,$orderNo)
|
public function real_name_result($user_id,$orderNo)
|
||||||
{
|
{
|
||||||
$user_mobile = db::name('user')->where(['id' => $user_id,'status'=>1])->value('mobile');
|
$user_mobile = db::name('user')->where(['id' => $user_id,'status'=>1])->value('mobile');
|
||||||
|
$id = db::name('user_auth')->where(['mobile' => $user_mobile,'is_real' => 3])->value('id');
|
||||||
|
if($id){
|
||||||
|
$res = db::name('user_auth')->where(['id' => ['<>',$id],'mobile' => $user_mobile])->select();
|
||||||
|
if($res){
|
||||||
|
foreach ($res as $key => $value) {
|
||||||
|
db::name('user_auth')->where('id' , $value['id'])->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//修改状态
|
//修改状态
|
||||||
$reslut = db::name('user_auth')->where('mobile' , $user_mobile)->update(['is_real' => 1]);
|
$reslut = db::name('user_auth')->where('id' , $id)->update(['is_real' => 1]);
|
||||||
if(!$reslut){
|
if(!$reslut){
|
||||||
return ['code' => 0, 'msg' => '实名失败','data' =>null];
|
return ['code' => 0, 'msg' => '实名失败','data' =>null];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user