['bsa.bidding_decision_id', 'bsa.applier', 'bsa.pay_type'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/12/16 10:46 */ public function lists(): array { return Db::name('BidSecurityApply')->alias('bsa') ->where($this->searchWhere) ->whereNull('bsa.delete_time') ->leftJoin('bid_bidding_decision bbd','bbd.id = bsa.bidding_decision_id') ->leftJoin('project p','p.id = bbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id') ->field('bsa.*, bbd.project_id, bbd.bidding_time, bbd.margin_amount, p.name as project_name, p.project_code, ct.name as customer_name') ->limit($this->limitOffset, $this->limitLength) ->order(['bsa.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']); return $item; }) ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2023/12/16 10:46 */ public function count(): int { return Db::name('BidSecurityApply')->alias('bsa') ->where($this->searchWhere) ->whereNull('bsa.delete_time') ->leftJoin('bid_bidding_decision bbd','bbd.id = bsa.bidding_decision_id') ->leftJoin('project p','p.id = bbd.project_id') ->leftJoin('custom ct','ct.id = p.custom_id')->count(); } }