['bbd.project_id', 'bbd.bidding_project_fund_source', 'bbd.bid_type'], ]; } /** * @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:14 */ public function lists(): array { return Db::name('BidBiddingDecision')->alias('bbd') ->where($this->searchWhere) ->whereNull('bbd.delete_time') ->leftJoin('project p','p.id = bbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id') ->field('bbd.*, p.custom_id, p.name as project_name, p.project_code, ct.name as custom_name') ->limit($this->limitOffset, $this->limitLength) ->order(['bbd.id' => 'desc']) ->select()->each(function($item, $key){ //关联数据后续添加 $item['approve_no'] = '付款单号'; $item['approve_step'] = '流程步骤'; $item['approve_settle_status'] = 1; $item['bidding_time'] = empty($item['bidding_time']) ? '' : date('Y-m-d H:i:s', $item['bidding_time']); $item['buy_bid_document_date'] = empty($item['buy_bid_document_date']) ? '' : date('Y-m-d H:i:s', $item['buy_bid_document_date']); $item['bid_opening_date'] = empty($item['bid_opening_date']) ? '' : date('Y-m-d H:i:s', $item['bid_opening_date']); $item['margin_amount_return_date'] = empty($item['bid_opening_date']) ? '' : date('Y-m-d H:i:s', $item['margin_amount_return_date']); return $item; }) ->toArray(); } /** * @notes 获取投标决策数量 * @return int * @author likeadmin * @date 2023/11/27 18:14 */ public function count(): int { return Db::name('BidBiddingDecision')->alias('bbd') ->where($this->searchWhere) ->whereNull('bbd.delete_time') ->leftJoin('project p','p.id = bbd.project_id')->count(); } }