| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 | 
							- <?php
 
- namespace App\Admin\Exports\Content;
 
- use App\Admin\Exports\ViewExport;
 
- use Illuminate\Contracts\View\View;
 
- use Illuminate\Support\Collection;
 
- class HouseApplyZrExport extends ViewExport
 
- {
 
-     /**
 
-      * 设置文件名
 
-      * @return string
 
-      */
 
-     public function getFilename(): string
 
-     {
 
-         return "house_apply.xlsx";
 
-     }
 
-     /**
 
-      * 渲染对应的视图
 
-      * @param Collection $data 导出的数据
 
-      * @return View
 
-      */
 
-     public function getView(Collection $data): View
 
-     {
 
-         $status = ['未知', '待审核', '审核通过', '审核驳回', '审核不通过'];
 
-         $marry  = ['未知', '未婚', '已婚', '离异', '丧偶'];
 
-         $no     = 1;
 
-         foreach ($data as $row) {
 
-             $family = empty($row->family) ? '' : json_decode($row->family, true);
 
-             if (!empty($family)) {
 
-                 $relation = [];
 
-                 $child    = [];
 
-                 $id_card  = [];
 
-                 foreach ($family as $v) {
 
-                     $relation[] = $v['relation'];
 
-                     $child[]    = $v['realname'];
 
-                     $id_card[]  = $v['idcard'];
 
-                 }
 
-                 $row['relation']         = implode('/', $relation);
 
-                 $row['relation_name']    = implode('/', $child);
 
-                 $row['relation_id_card'] = implode('/', $id_card);
 
-             }
 
-             $row['no'] = $no;
 
-             $no++;
 
-             $row['status_text']   = $status[$row['zr_check_status']];
 
-             $row['check_time']    = $row['zr_check_time'];
 
-             $row['check_comment'] = $row['zr_check_comment'];
 
-             $row['marry_text']    = $marry[$row['marry']];
 
-         }
 
-         return view('admin.content.export_house_apply', ['data' => $data]);
 
-     }
 
- }
 
 
  |