['project_id', 'bid_document_no', 'invite_tenders_company_name', 'bid_company_name'], ]; } /** * @notes 获取购买标书列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/11/27 18:22 */ public function lists(): array { return Db::name('BidBuyBiddingDocument')->alias('bbbd') ->where($this->searchWhere) ->whereNull('bbbd.delete_time') ->leftJoin('project p','p.id = bbbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id') ->field('bbbd.*, bbbd.project_id, p.name as project_name, p.project_code, ct.name as customer_name') ->limit($this->limitOffset, $this->limitLength) ->order(['bbbd.id' => 'desc']) ->select()->each(function($item, $key){ //关联数据后续添加 $item['approve_no'] = '付款单号'; $item['approve_step'] = '流程步骤'; $item['approve_settle_status'] = 1; $item['bid_date'] = empty($item['bid_date']) ? '' : date('Y-m-d H:i:s', $item['bid_date']); $item['buy_date'] = empty($item['buy_date']) ? '' : date('Y-m-d H:i:s', $item['buy_date']); return $item; }) ->toArray(); } /** * @notes 获取购买标书数量 * @return int * @author likeadmin * @date 2023/11/27 18:22 */ public function count(): int { return Db::name('BidBuyBiddingDocument')->alias('bbbd') ->where($this->searchWhere) ->whereNull('bbbd.delete_time') ->leftJoin('project p','p.id = bbbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id')->count(); } }