['num', 'project', 'project_num'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/02/23 13:47 */ public function lists(): array { return ProjectProgressPayment::with(['projectInfo'])->where($this->searchWhere) ->append(['children']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->withAttr('children', function ($value, $data){ $details = ProjectProgressPaymentDetail::where('project_progress_payment_id', $data['id'])->select(); return $details; }) ->select() ->each(function($item){ $item['annex'] = json_decode($item['annex'], true); }) ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2024/02/23 13:47 */ public function count(): int { return ProjectProgressPayment::where($this->searchWhere)->count(); } public function setFileName(): string { return '项目进度汇报'; } /** * @notes 导出字段 * @return string[] * @author 段誉 * @date 2022/11/24 16:17 */ public function setExcelFields(): array { return [ 'id' => 'id', 'num' => '单据编号', 'project_id' => '项目id', 'djr' => '登记人', 'djrq' => '登记人', 'sbhj' => '进度申报造价合计', 'shhj' => '进度审核造价合计', 'ljhj' => '累计应付工程款合计' ]; } }