['expense_reimbursement_id'], ]; } /** * @notes 获取财务管理--费用报销单--报销明细列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/28 09:26 */ public function lists(): array { return FinancialExpenseReimbursementDetail::where($this->searchWhere) ->field(['id', 'expense_reimbursement_id', 'dept_id', 'date', 'subject_name', 'amount', 'abstract']) ->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; }) ->toArray(); } /** * @notes 获取财务管理--费用报销单--报销明细数量 * @return int * @author likeadmin * @date 2024/03/28 09:26 */ public function count(): int { return FinancialExpenseReimbursementDetail::where($this->searchWhere)->count(); } }