['using_funds_id'], ]; } /** * @notes 获取财务管理--用款申请单--申请明细列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/29 09:29 */ public function lists(): array { return FinancialUsingFundsDetail::where($this->searchWhere) ->field(['id', 'using_funds_id', 'dept_id', 'date', 'subject_name', 'amount', 'abstract', 'invoice']) ->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['subject_name_text'] = $data->subject_name_text; $data['subject_name'] = (string)$data['subject_name']; }) ->toArray(); } /** * @notes 获取财务管理--用款申请单--申请明细数量 * @return int * @author likeadmin * @date 2024/03/29 09:29 */ public function count(): int { return FinancialUsingFundsDetail::where($this->searchWhere)->count(); } }