bug修改
This commit is contained in:
@@ -106,11 +106,23 @@ class Tasks extends Model
|
||||
$reslut['gift_box_list'][$key]['status_str'] = '已用完('.$reslut['gift_box_list'][$key]['taday_number'].'/'.$ext['num'].')';
|
||||
}
|
||||
}
|
||||
//判断用户是否实名认证,并查询用户手机号下的用户
|
||||
$is_real = model('UserData')->real_name_info($user_id);
|
||||
if($is_real['code']==1){
|
||||
if($is_real['data']['is_real'] ==1){
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['data']['mobile'])->column('id');
|
||||
//查询是否实名认证
|
||||
$mobile = db::name('user')->where(['id' => $user_id,'status'=>1])->value('mobile');
|
||||
$is_real = db::name('user_auth')->where('mobile' , $mobile)->field('real_name,card_id,is_real,mobile')->find();
|
||||
if(empty($is_real)){
|
||||
return ['code' => 0, 'msg' => '请先实名认证','data' => null];
|
||||
}else{
|
||||
if($is_real['is_real'] !=1){
|
||||
return ['code' => 0, 'msg' => '请先实名认证','data' => null];
|
||||
}else{
|
||||
//查询同一个身份证下的 用户
|
||||
$user_auth_mobile = db::name('user_auth')->where(['card_id'=>$is_real['card_id']])->column('mobile');
|
||||
if(count($user_auth_mobile)>1){
|
||||
$user_ids = db::name('user')->whereIn('mobile',$user_auth_mobile)->column('id');
|
||||
}else{
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['mobile'])->column('id');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,15 +347,41 @@ class Tasks extends Model
|
||||
$user_daily_tasks = Db::name('vs_tasks_user_daily')->where('user_id',$user_id)->where('task_id',$task_id)->whereTime('createtime', 'today')->find();
|
||||
}else{
|
||||
if($task_info['task_type'] == 1){
|
||||
//判断用户是否实名认证,并查询用户手机号下的用户
|
||||
$is_real = model('UserData')->real_name_info($user_id);
|
||||
if($is_real['code']==1){
|
||||
if($is_real['data']['is_real'] ==1){
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['data']['mobile'])->column('id');
|
||||
$user_daily_tasks = Db::name('vs_tasks_user_daily')->whereIn('user_id',$user_ids)->where('task_id',$task_id)->find();
|
||||
if($user_daily_tasks){
|
||||
return ['code' => 0, 'msg' => '您已完成该任务','data' => null];
|
||||
//查询是否实名认证
|
||||
$mobile = db::name('user')->where(['id' => $user_id,'status'=>1])->value('mobile');
|
||||
$is_real = db::name('user_auth')->where('mobile' , $mobile)->field('real_name,card_id,is_real,mobile')->find();
|
||||
if(empty($is_real)){
|
||||
return ['code' => 0, 'msg' => '请先实名认证','data' => null];
|
||||
}else{
|
||||
if($is_real['is_real'] !=1){
|
||||
return ['code' => 0, 'msg' => '请先实名认证','data' => null];
|
||||
}else{
|
||||
//查询同一个身份证下的 用户
|
||||
$user_auth_mobile = db::name('user_auth')->where(['card_id'=>$is_real['card_id']])->column('mobile');
|
||||
if(count($user_auth_mobile)>1){
|
||||
$user_ids = db::name('user')->whereIn('mobile',$user_auth_mobile)->column('id');
|
||||
}else{
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['mobile'])->column('id');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断用户是否实名认证,并查询用户手机号下的用户
|
||||
$mobile = db::name('user')->where(['id' => $user_id,'status'=>1])->value('mobile');
|
||||
$is_real = db::name('user_auth')->where('mobile' , $mobile)->field('real_name,card_id,is_real,mobile')->find();
|
||||
if($is_real['is_real'] ==1){
|
||||
//查询同一个身份证下的 用户
|
||||
$user_auth_mobile = db::name('user_auth')->where(['card_id'=>$is_real['card_id']])->column('mobile');
|
||||
if(count($user_auth_mobile)>1){
|
||||
$user_ids = db::name('user')->whereIn('mobile',$user_auth_mobile)->column('id');
|
||||
}else{
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['mobile'])->column('id');
|
||||
}
|
||||
$user_daily_tasks = Db::name('vs_tasks_user_daily')->whereIn('user_id',$user_ids)->where('task_id',$task_id)->find();
|
||||
if($user_daily_tasks){
|
||||
return ['code' => 0, 'msg' => '您已完成该任务','data' => null];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,14 +472,22 @@ class Tasks extends Model
|
||||
//领取每日任务奖励
|
||||
public function daily_tasks_receive($user_id,$task_id,$student_id = 0){
|
||||
//查询是否实名认证
|
||||
$is_real = model('UserData')->real_name_info($user_id);
|
||||
if($is_real['code']==0){
|
||||
$mobile = db::name('user')->where(['id' => $user_id,'status'=>1])->value('mobile');
|
||||
$is_real = db::name('user_auth')->where('mobile' , $mobile)->field('real_name,card_id,is_real,mobile')->find();
|
||||
if(empty($is_real)){
|
||||
return ['code' => 0, 'msg' => '请先实名认证','data' => null];
|
||||
}else{
|
||||
if($is_real['data']['is_real'] !=1){
|
||||
if($is_real['is_real'] !=1){
|
||||
return ['code' => 0, 'msg' => '请先实名认证','data' => null];
|
||||
}else{
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['data']['mobile'])->column('id');
|
||||
//查询同一个身份证下的 用户
|
||||
$user_auth_mobile = db::name('user_auth')->where(['card_id'=>$is_real['card_id']])->column('mobile');
|
||||
if(count($user_auth_mobile)>1){
|
||||
$user_ids = db::name('user')->whereIn('mobile',$user_auth_mobile)->column('id');
|
||||
}else{
|
||||
$user_ids = db::name('user')->where('mobile',$is_real['mobile'])->column('id');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$task_info = Db::name('vs_tasks')->where('id',$task_id)->find();
|
||||
|
||||
Reference in New Issue
Block a user