|
@@ -814,12 +814,25 @@ class Writereport extends Base
|
|
|
$rinfo = DB::table('report')->where('exam_id',$param['id'])->find();
|
|
|
if($rinfo){
|
|
|
DB::table('report')->where('exam_id',$param['id'])->update($report);
|
|
|
+ $rinfo = DB::table('report')->where('exam_id',$param['id'])->find();
|
|
|
+ $rid = $rinfo['id'];
|
|
|
}else{
|
|
|
$report['id'] = UUIDs::uuid16();
|
|
|
$report['exam_id'] = $param['id'];
|
|
|
$report['createdAt'] = date('Y-m-d H:i:s',time());
|
|
|
DB::table('report')->insert($report);
|
|
|
+ $rid = $report['id'];
|
|
|
}
|
|
|
+ $log = array();
|
|
|
+ $log['id'] = UUIDs::uuid16();
|
|
|
+ $log['impression'] = isset($param['ext']) ? $param['ext'] : '';
|
|
|
+ $log['description'] = isset($param['description']) ? $param['description'] : '';
|
|
|
+ $log['report_id'] = $rid;
|
|
|
+ $log['createdAt'] = date('Y-m-d H:i:s',time());
|
|
|
+ $log['doctor_id'] = $doctor['id'];
|
|
|
+ $log['type'] = 1; //写报告
|
|
|
+ log::record($log);
|
|
|
+ $report_log = DB::table('report_record')->insert($log);
|
|
|
return json_encode(['status'=>'ok','msg'=>'成功','code'=>'0000']);
|
|
|
}
|
|
|
}
|