|
|
|
|
@ -47,14 +47,19 @@ class AppointmentController extends Controller
|
|
|
|
|
$c=DB::table('appointment_record as a')
|
|
|
|
|
->where([['a.id_card_num','=',$info['id_card_num']],['a.is_del','=',0],['a.fee_type','=',0],['a.created_at','>=',$firstDay],['a.created_at','<=',$lastDay]])->get();
|
|
|
|
|
if(count($c)>0){
|
|
|
|
|
$result['status']=false;
|
|
|
|
|
$result['msg']='已体检过';
|
|
|
|
|
$result['info']=$c;
|
|
|
|
|
if($c[0]->status==2){
|
|
|
|
|
return \Yz::Return(false,'本年度已经有体检登记记录',['info'=>$c]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//如果是预约状态,则修改状态为 到检
|
|
|
|
|
if($c[0]->status==1){
|
|
|
|
|
$up=DB::table('appointment_record')->where(['id'=>$c[0]->id])->update(['status'=>2]);
|
|
|
|
|
if($up){
|
|
|
|
|
return \Yz::Return(true,'保存成功',[]);
|
|
|
|
|
}else{
|
|
|
|
|
$result['status']=true;
|
|
|
|
|
$result['msg']='可以继续,本年度无免费体检记录';
|
|
|
|
|
$result['info']=$c;
|
|
|
|
|
return \Yz::echoError1('保存失败');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$currentDateTime = date('Y-m-d H:i:s');
|
|
|
|
|
$org_code=isset($info['org_code'])?$info['org_code']:'';
|
|
|
|
|
@ -69,7 +74,7 @@ class AppointmentController extends Controller
|
|
|
|
|
'id_card_num'=>$info['id_card_num'],
|
|
|
|
|
'sex'=>$info['sex'],
|
|
|
|
|
'tel'=>$info['tel'],
|
|
|
|
|
'status'=>1,
|
|
|
|
|
'status'=>2, //1预约2到检 只要调用这个接口 直接到检
|
|
|
|
|
'is_del'=>0,
|
|
|
|
|
//'content'=>json_encode($info['content']),
|
|
|
|
|
'content'=>isset($info['content'])?json_encode($info['content'],JSON_UNESCAPED_UNICODE):'',
|
|
|
|
|
|