|
|
|
|
@ -91,22 +91,30 @@ class AppointmentService
|
|
|
|
|
$query->where('a.id_card_num', $id_card_num)
|
|
|
|
|
->orWhere('a.id_card_num', $encode_id_card_num);
|
|
|
|
|
})
|
|
|
|
|
->where(['a.type' => $type,'a.is_del'=>0, ['a.created_at', '>=', $firstDay], ['a.created_at', '<=', $lastDay]])
|
|
|
|
|
->whereIn('a.status', [1, 2])
|
|
|
|
|
->get();
|
|
|
|
|
->where(['a.type' => $type,'a.is_del'=>0, ['a.created_at', '>=', $firstDay], ['a.created_at', '<=', $lastDay]]);
|
|
|
|
|
if($type==2){
|
|
|
|
|
$c=$c->whereIn('a.status', [1, 2]);
|
|
|
|
|
}
|
|
|
|
|
if($type==1){
|
|
|
|
|
$c=$c->whereIn('a.status', [2]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$c=$c->get();
|
|
|
|
|
if(count($c)){
|
|
|
|
|
$result['status']=false;
|
|
|
|
|
$result['msg']='已体检过';
|
|
|
|
|
$result['info']=$c;
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
$gongwei= self::CheckGongWei($name,$id_card_num);
|
|
|
|
|
if( $gongwei['status']===false) {
|
|
|
|
|
$result['status'] = false;
|
|
|
|
|
$result['msg'] = $gongwei['msg'];
|
|
|
|
|
$result['GongWeiinfo'] = $gongwei['GongWeiinfo'];
|
|
|
|
|
return $result;
|
|
|
|
|
}
|
|
|
|
|
if($type==2){
|
|
|
|
|
$gongwei= self::CheckGongWei($name,$id_card_num);
|
|
|
|
|
if( $gongwei['status']===false) {
|
|
|
|
|
$result['status'] = false;
|
|
|
|
|
$result['msg'] = $gongwei['msg'];
|
|
|
|
|
$result['GongWeiinfo'] = $gongwei['GongWeiinfo'];
|
|
|
|
|
return $result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$result['status']=true;
|
|
|
|
|
$result['msg']='可以继续,本年度无免费体检记录';
|
|
|
|
|
$result['info']=$c;
|
|
|
|
|
|