['travel_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 14:23 */ public function lists(): array { return FinancialTravelReimbursementDetail::where($this->searchWhere) ->field(['id', 'travel_reimbursement_id', 'dept_id', 'date', 'address', 'traffic_amount', 'stay_amount', 'stay_days', 'stay_price', 'subsidy_days', 'subsidy_price', 'subsidy_amount', 'subsidy_deduction', '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']; }) ->toArray(); } /** * @notes 获取财务管理--差旅费报销单--报销明细数量 * @return int * @author likeadmin * @date 2024/03/28 14:23 */ public function count(): int { return FinancialTravelReimbursementDetail::where($this->searchWhere)->count(); } }