|
|
|
@ -31,14 +31,14 @@ class RecordQueryController extends Controller
|
|
|
|
if ($type == 1) {
|
|
|
|
if ($type == 1) {
|
|
|
|
// 查询预约表
|
|
|
|
// 查询预约表
|
|
|
|
$records = DB::table('appointment_record')
|
|
|
|
$records = DB::table('appointment_record')
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', 'org_name')
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', DB::raw('(select org_name from medical_institution where sn = org_code) as org_name'))
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->where('is_del', 0)
|
|
|
|
->where('is_del', 0)
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 查询登记表
|
|
|
|
// 查询登记表
|
|
|
|
$records = DB::table('examination_records')
|
|
|
|
$records = DB::table('examination_records')
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', DB::raw('(select name from medical_institution where id = institution_id) as org_name'))
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', DB::raw('(select org_name from medical_institution where id = institution_id) as org_name'))
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->where('is_del', 0)
|
|
|
|
->where('is_del', 0)
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
@ -75,14 +75,14 @@ class RecordQueryController extends Controller
|
|
|
|
if ($type == 1) {
|
|
|
|
if ($type == 1) {
|
|
|
|
// 查询预约表
|
|
|
|
// 查询预约表
|
|
|
|
$records = DB::table('appointment_record')
|
|
|
|
$records = DB::table('appointment_record')
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', 'org_name')
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', DB::raw('(select org_name from medical_institution where sn = org_code) as org_name'))
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->where('is_del', 0)
|
|
|
|
->where('is_del', 0)
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 查询登记表
|
|
|
|
// 查询登记表
|
|
|
|
$records = DB::table('examination_records')
|
|
|
|
$records = DB::table('examination_records')
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', DB::raw('(select name from medical_institution where id = institution_id) as org_name'))
|
|
|
|
->select('name', 'tel', 'id_card_num', 'created_at', DB::raw('(select org_name from medical_institution where id = institution_id) as org_name'))
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->whereBetween('created_at', [$startDate, $endDate])
|
|
|
|
->where('is_del', 0)
|
|
|
|
->where('is_del', 0)
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
|