id; $result['realname'] = $row->memberInfos ? $row->memberInfos->realname : ''; $result['title'] = $row->title; $result['display'] = $row->display ? '公开' : '保密'; $result['complete_percent'] = $row->complete_percent.'%'; if($row->audit==0){ $audit = '审核未通过'; }elseif ($row->audit==2){ $audit = '审核通过'; }else{ $audit = '等待审核'; } $result['audit'] = $audit; $result['sex_cn'] = $row->memberInfos ? $row->memberInfos->sex_cn : ''; $birthday = ''; if($row->memberInfos){ $birthday = date('Y')-$row->memberInfos->birthday; } $result['birthday'] = $birthday; $result['residence_cn'] = $row->memberInfos ? $row->memberInfos->residence_cn : ''; $result['householdaddress_cn'] = $row->memberInfos ? $row->memberInfos->householdaddress_cn : ''; $result['marriage_cn'] = $row->memberInfos ? $row->memberInfos->marriage_cn : ''; $result['experience_cn'] = $row->memberInfos ? $row->memberInfos->experience_cn : ''; $result['nature_cn'] = $row->nature_cn; $result['intention_jobs'] = $row->intention_jobs; $result['district_cn'] = $row->district_cn; $result['wage_cn'] = $row->wage_cn; $result['education_cn'] = $row->memberInfos ? $row->memberInfos->education_cn : ''; $education = $row->resumeEducation()->orderByRaw('startyear desc, startmonth desc')->first(); $result['school'] = $education ? $education->school : ''; $result['major_cn'] = $row->memberInfos ? $row->memberInfos->major_cn : ''; $result['phone'] = $row->memberInfos ? $row->memberInfos->phone : ''; $result['email'] = $row->memberInfos ? $row->memberInfos->email : ''; $result['created_at'] = $row->created_at; $result['updated_at'] = $row->updated_at; return $result; } /** * 设置文件名 * @return string */ public function getFilename(): string { return "resume.xlsx"; } /** * 格式化指定列. * 只有在需要的时候设置,例如在身份证不要显示科学计数时设定列格式:['A'=>NumberFormat::FORMAT_NUMBER] * @return array */ public function columnFormats(): array { return [ ]; } }