['bsr.bidding_decision_id', 'bsr.refund_date', 'bsr.bank_account_id'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/12/18 10:29 */ public function lists(): array { return Db::name('BidSecurityRefund')->alias('bsr') ->where($this->searchWhere) ->whereNull('bsr.delete_time') ->leftJoin('bid_bidding_decision bbd','bbd.id = bsr.bidding_decision_id') ->leftJoin('project p','p.id = bbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id') ->field('bsr.*, bbd.project_id, p.name as project_name, p.project_code, ct.name as customer_name') ->limit($this->limitOffset, $this->limitLength) ->order(['bsr.id' => 'desc']) ->select()->each(function($item, $key){ //关联数据后续添加 $item['approve_no'] = '付款单号'; $item['approve_step'] = '流程步骤'; $item['approve_settle_status'] = 1; return $item; }) ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2023/12/18 10:29 */ public function count(): int { return Db::name('BidSecurityRefund')->alias('bsr') ->where($this->searchWhere) ->whereNull('bsr.delete_time') ->leftJoin('bid_bidding_decision bbd','bbd.id = bsr.bidding_decision_id') ->leftJoin('project p','p.id = bbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id')->count(); } }