['department_income_settlement_id', 'dept_id', 'type'], '%like%' => ['settlement_code'], ]; } /** * @notes 获取财务管理--部门收入结算--结算明细列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/27 09:46 */ public function lists(): array { return FinancialDepartmentIncomeSettlementDetail::where($this->searchWhere) ->field(['id', 'department_income_settlement_id', 'dept_id', 'type', 'amount', 'settlement_amount', 'settlement_code', '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'] = (string)$data['type']; $data['type_text'] = $data->type_text; }) ->toArray(); } /** * @notes 获取财务管理--部门收入结算--结算明细数量 * @return int * @author likeadmin * @date 2024/03/27 09:46 */ public function count(): int { return FinancialDepartmentIncomeSettlementDetail::where($this->searchWhere)->count(); } }