liyinglin 2 years ago
parent 014a456ef6
commit 4795e365bb

@ -79,22 +79,21 @@ class VisitController extends CommonController
}); });
})->orderBy($all['sort_name'] ?? 'id', $all['sort_type'] ?? 'desc'); })->orderBy($all['sort_name'] ?? 'id', $all['sort_type'] ?? 'desc');
if (isset($all['is_export']) && !empty($all['is_export'])) { if (isset($all['is_export']) && !empty($all['is_export'])) {
dd($list->limit(5000)->get()->toArray());
return (new FastExcel($list->limit(5000)->get()->toArray()))->download('访问记录' . date('YmdHis') . '.csv', function ($info) { return (new FastExcel($list->limit(5000)->get()->toArray()))->download('访问记录' . date('YmdHis') . '.csv', function ($info) {
return [ return [
'姓名' => $info['name'], '姓名' => $info['name']??'',
'类型' => $info['type_text'], '类型' => $info['type_text']??'',
'审核状态' => $info['audit_status_text'], '审核状态' => $info['audit_status_text']??'',
'是否随访' => empty($info['follw_people']) ? '否' : '是', '是否随访' => empty($info['follw_people']) ? '否' : '是',
'预约时间' => $info['date'], '预约时间' => $info['date']??'',
'证件号' => $info['idcard'], '证件号' => $info['idcard']??'',
'证件类型' => $info['credent'] == 1 ? '身份证' : '护照', '证件类型' => $info['credent'] == 1 ? '身份证' : '护照',
'单位名称' => $info['company_name'], '单位名称' => $info['company_name']??'',
'手机号' => $info['mobile'], '手机号' => $info['mobile']??'',
'访问时间' => ($info['visit_time']['start_time']) ?? '', '访问时间' => ($info['visit_time']['start_time']) ?? '',
'结束时间' => ($info['visit_time']['end_time']) ?? '', '结束时间' => ($info['visit_time']['end_time']) ?? '',
'创建人' => $info['admin']['name'], '创建人' => $info['admin']['name']??'',
'创建时间' => $info['created_at'], '创建时间' => $info['created_at']??'',
]; ];
}); });
} else { } else {

Loading…
Cancel
Save