['project_id'], ]; } /** * @notes 获取成本调整列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/01/17 13:43 */ public function lists(): array { return ProjectCostAdjustment::where($this->searchWhere) ->field(['id', 'project_id', 'adjust_date', 'adjust_amount', 'remark', 'annex']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($data){ $project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty(); $data['project_name'] = $project['name']; $data['project_code'] = $project['project_code']; return $data; }) ->toArray(); } /** * @notes 获取成本调整数量 * @return int * @author likeadmin * @date 2024/01/17 13:43 */ public function count(): int { return ProjectCostAdjustment::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", "project_name" => "项目名称", "project_code" => "项目编码", "adjust_date" => "调整日期", "adjust_amount" => "调整金额", "remark" => "备注", ]; } }