|
|
|
|
@ -29,11 +29,20 @@ class AppointmentController extends Controller
|
|
|
|
|
$source='接口';
|
|
|
|
|
$info=request('info');
|
|
|
|
|
//HSM加密
|
|
|
|
|
$HSM =\App\Lib\HSM::HsmEncrypt($info['id_card_num']);
|
|
|
|
|
if($HSM['status']!=true){
|
|
|
|
|
return \Yz::echoError1('身份证号加密失败');
|
|
|
|
|
$HSM_sfz =\App\Lib\HSM::HsmEncrypt($info['id_card_num']);
|
|
|
|
|
if($HSM_sfz['status']!=true){
|
|
|
|
|
return \Yz::echoError1('调用HSM加密失败');
|
|
|
|
|
}
|
|
|
|
|
$info['id_card_num']=$HSM['data'];
|
|
|
|
|
$info['id_card_num']=$HSM_sfz['data'];
|
|
|
|
|
|
|
|
|
|
if(isset($info['tel'])){
|
|
|
|
|
$HSM_tel =\App\Lib\HSM::HsmEncrypt($info['tel']);
|
|
|
|
|
if($HSM_tel['status']!=true){
|
|
|
|
|
return \Yz::echoError1('调用HSM加密失败');
|
|
|
|
|
}
|
|
|
|
|
$info['tel']=$HSM_tel['data'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$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();
|
|
|
|
|
@ -47,8 +56,12 @@ class AppointmentController extends Controller
|
|
|
|
|
$result['msg']='可以继续,本年度无免费体检记录';
|
|
|
|
|
$result['info']=$c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$currentDateTime = date('Y-m-d H:i:s');
|
|
|
|
|
$org_code=isset($info['org_code'])?$info['org_code']:'';
|
|
|
|
|
$Hmac=\App\Lib\HSM::Hmac($info['name'].$info['id_card_num'].$info['tel'].$org_code.$currentDateTime);
|
|
|
|
|
if($Hmac['status']!=true){
|
|
|
|
|
return \Yz::echoError1('HMAC摘要失败');
|
|
|
|
|
}
|
|
|
|
|
$i=DB::table('appointment_record')->insert([
|
|
|
|
|
'source'=>$source,
|
|
|
|
|
'type'=>$info['type'],
|
|
|
|
|
@ -61,9 +74,10 @@ class AppointmentController extends Controller
|
|
|
|
|
//'content'=>json_encode($info['content']),
|
|
|
|
|
'content'=>isset($info['content'])?json_encode($info['content'],JSON_UNESCAPED_UNICODE):'',
|
|
|
|
|
'fee_type'=>$info['fee_type'],
|
|
|
|
|
'org_code'=>isset($info['org_code'])?json_encode($info['org_code'],JSON_UNESCAPED_UNICODE):'',
|
|
|
|
|
'org_name'=>isset($info['org_name'])?json_encode($info['org_name'],JSON_UNESCAPED_UNICODE):'',
|
|
|
|
|
|
|
|
|
|
'org_code'=>$org_code,
|
|
|
|
|
'org_name'=>isset($info['org_name'])?$info['org_name']:'',
|
|
|
|
|
'created_at'=>$currentDateTime,
|
|
|
|
|
'hmac'=>$Hmac['data'],
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
if($i){
|
|
|
|
|
|