['budget_doc_id', 'dept_id', 'type'], ]; } /** * @notes 获取财务管理--项目预算书--预算明细列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/26 13:54 */ public function lists(): array { return FinancialBudgetDocDetail::withoutField('create_time,update_time,delete_time')->where($this->searchWhere) ->field(['id', 'budget_doc_id', 'dept_id', 'type', 'amount', 'remark']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($data) { $dept = Dept::field('name')->where('id', $data['dept_id'])->findOrEmpty(); $data['dept_name'] = $dept['name']; $data['type_text'] = $data->type_text; }) ->toArray(); } /** * @notes 获取财务管理--项目预算书--预算明细数量 * @return int * @author likeadmin * @date 2024/03/26 13:54 */ public function count(): int { return FinancialBudgetDocDetail::where($this->searchWhere)->count(); } }