|
@@ -78,12 +78,22 @@ class Writereport extends Base
|
|
|
if(isset($param['rid']) && !empty($param['rid'])){
|
|
|
$remote_id = $param['rid'];
|
|
|
$report = DB::table('report')->where('exam_id',$id)->where('remote_application_id',$remote_id)->field('qr_code,id,remote_application_id,report_result,report_datetime,report_doctor_id,review_datetime,review_doctor_id,impression,description')->find();
|
|
|
+ if(empty($report))
|
|
|
+ {
|
|
|
+ $r = ['id'=>UUIDs::uuid16(),'exam_id'=>$id,'remote_application_id'=>$remote_id,'type'=>2];
|
|
|
+ DB::table('report')->insert($r);
|
|
|
+ }
|
|
|
$sta = DB::table('remote_application')->where('id',$remote_id)->field('report_status')->find();
|
|
|
$info['report_status'] = $sta['report_status'];
|
|
|
$r_id = $report['remote_application_id'];
|
|
|
}else{
|
|
|
// 不存在 本地点击进入 获取本地报告
|
|
|
$report = DB::table('report')->where('exam_id',$id)->where('type',1)->field('qr_code,id,remote_application_id,report_result,report_datetime,report_doctor_id,review_datetime,review_doctor_id,impression,description')->find();
|
|
|
+ if(empty($report))
|
|
|
+ {
|
|
|
+ $r = ['id'=>UUIDs::uuid16(),'exam_id'=>$id,'type'=>1];
|
|
|
+ DB::table('report')->insert($r);
|
|
|
+ }
|
|
|
$info['report_status'] = '';
|
|
|
$r_report = DB::table('report')->where('exam_id',$id)->where('type',2)->field('remote_application_id')->find();
|
|
|
$r_id = $r_report['remote_application_id'] ?? null;
|