|
|
|
@ -13,24 +13,68 @@ class ReportController extends Controller
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$openid = request('openid');
|
|
|
|
$openid = request('openid');
|
|
|
|
$tj_status = request('tj_status');
|
|
|
|
$tj_status = request('tj_status');
|
|
|
|
|
|
|
|
$hospital_id=request('hospital_id');
|
|
|
|
if (!isset($openid)) return \Yz::echoError1("openid不能为空");
|
|
|
|
if (!isset($openid)) return \Yz::echoError1("openid不能为空");
|
|
|
|
|
|
|
|
|
|
|
|
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
if (!$user) return \Yz::echoError1('用户不存在');
|
|
|
|
if (!$user) return \Yz::echoError1('用户不存在');
|
|
|
|
$persons = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
|
|
|
|
$persons = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
|
|
|
|
|
|
|
|
$report_list=[];
|
|
|
|
$list = DB::table('report_l1_records')->select('姓名', '性别', '登记时间', '套餐名称', '体检号', '体检状态', 'is_read')->whereIn('证件号码', $persons);
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
if(isset($tj_status) and $tj_status!==0){
|
|
|
|
foreach ($persons as $key => $id_number) {
|
|
|
|
if($tj_status===1){
|
|
|
|
$data = [
|
|
|
|
$tj_status='报告未出';
|
|
|
|
'电话号码' => "",
|
|
|
|
|
|
|
|
'证件号码' => $id_number,
|
|
|
|
|
|
|
|
'体检号' => ""
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$reports = $peis::Post('体检报告查询', $hospital_id, $data);
|
|
|
|
|
|
|
|
if (count($reports['data']) > 0) {
|
|
|
|
|
|
|
|
$reports_detail_list = $reports['data'];
|
|
|
|
|
|
|
|
foreach ($reports_detail_list as $key => $reports_detail) {
|
|
|
|
|
|
|
|
$report_list[]=$reports_detail;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($tj_status===2){
|
|
|
|
}
|
|
|
|
$tj_status='报告已出';
|
|
|
|
$list=[];
|
|
|
|
|
|
|
|
foreach ($report_list as $key => $report) {
|
|
|
|
|
|
|
|
$report_list[$key]['is_read']=0;
|
|
|
|
|
|
|
|
if($report['体检状态']=='报告已出' || $report['体检状态']=='总检完成'){
|
|
|
|
|
|
|
|
$cha=DB::table('report_l1_records')->where(['体检号' => $report['体检号']])->first();
|
|
|
|
|
|
|
|
if(!!$cha and $cha->is_read==1){
|
|
|
|
|
|
|
|
$report_list[$key]['is_read']=1;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$list=$list->where('体检状态', $tj_status);
|
|
|
|
if(isset($tj_status) and $tj_status!==0){
|
|
|
|
|
|
|
|
if($tj_status==1 and $report['体检状态']=='报告已出' || $report['体检状态']=='总检完成'){
|
|
|
|
|
|
|
|
$list[]= $report_list[$key];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if($tj_status==2 and $report['体检状态']=='报告未出'){
|
|
|
|
|
|
|
|
$list[]= $report_list[$key];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$list=$list->get();
|
|
|
|
|
|
|
|
return \Yz::Return(true, "查询完成", ['list' => $list]);
|
|
|
|
return \Yz::Return(true, "查询完成", ['list' => $list]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $list = DB::table('report_l1_records')->select('姓名', '性别', '登记时间', '套餐名称', '体检号', '体检状态', 'is_read')->whereIn('证件号码', $persons);
|
|
|
|
|
|
|
|
// if(isset($tj_status) and $tj_status!==0){
|
|
|
|
|
|
|
|
// if($tj_status===1){
|
|
|
|
|
|
|
|
// $tj_status='报告未出';
|
|
|
|
|
|
|
|
// $list=$list->where('体检状态', $tj_status);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if($tj_status===2){
|
|
|
|
|
|
|
|
// $tj_status='报告已出';
|
|
|
|
|
|
|
|
// $list=$list->where('体检状态', $tj_status);
|
|
|
|
|
|
|
|
// $list = $list->where(function ($query) use ($tj_status) {
|
|
|
|
|
|
|
|
// $query->where('体检状态', '报告已出')->orWhere('体检状态', '总检完成');
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// $list=$list->get();
|
|
|
|
|
|
|
|
// return \Yz::Return(true, "查询完成", ['list' => $list]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function GetReportJieLunJianYi()
|
|
|
|
public function GetReportJieLunJianYi()
|
|
|
|
|