['org_id', 'dept_id', 'document_type'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/12/20 15:51 */ public function lists(): array { return Db::name('RevenueExpenditureStatement')->alias('res') ->where($this->searchWhere) ->whereNull('res.delete_time') ->leftJoin('orgs o','o.id = res.org_id') ->leftJoin('dept d','d.id = res.dept_id') ->leftJoin('bank_account ba','ba.id = res.bank_account_id') ->field('res.*, ba.account_sn, ba.deposit_bank, ba.account_name, ba.account, d.name as dept_name, o.name as org_name') ->limit($this->limitOffset, $this->limitLength) ->order(['res.id' => 'desc']) ->select()->each(function($item, $key){ //关联数据后续添加 return $item; }) ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2023/12/20 15:51 */ public function count(): int { return Db::name('RevenueExpenditureStatement')->alias('res') ->where($this->searchWhere) ->whereNull('res.delete_time') ->leftJoin('orgs o','o.id = res.org_id') ->leftJoin('dept d','d.id = res.dept_id') ->leftJoin('bank_account ba','ba.id = res.bank_account_id')->count(); } }