, NUH-Odds GmbH * ***/ class ObjektProjektByMethode { public static function select($method) { if ($method == 1) { $arr = DbFunction::select( 'tx_gutachten_raume_all', ['tt_raume_basis_id', 'geschoss'], [ 'AND' => [ 'pid' => DbFunction::$projektid, 'tt_raumart_id' => 1 ], 'GROUP' => ['tt_raume_basis_id','geschoss'] ] ); $geschoss = []; foreach ($arr as $key => $value) { $geschoss[$value['tt_raume_basis_id']][] = $value['geschoss']; } } // DbFunction::$debug = 1; $arr = DbFunction::selectJoin( 'tx_gutachten_raume_basis', ['[>]tx_gutachten_orientierung' => ['tx_gutachten_raume_basis.tt_orientierung_id' => 'id'], '[>]tx_gutachten_raume_all' => ['tx_gutachten_raume_basis.id' => 'tt_raume_basis_id'], ], [ 'tx_gutachten_raume_basis.id', 'tx_gutachten_raume_basis.topNr', 'tx_gutachten_raume_basis.typ', 'tx_gutachten_raume_basis.GNO', 'tx_gutachten_orientierung.orientierung', 'tx_gutachten_raume_all.geschoss', ], [ 'tx_gutachten_raume_basis.pid' => DbFunction::$projektid, 'tx_gutachten_raume_all.tt_raumart_id' => $method, 'GROUP' => 'tx_gutachten_raume_basis.id', 'ORDER' => ['tx_gutachten_raume_basis.topNr' => 'ASC'], ] ); if ($method == 1) { foreach ($arr as $key => $value) { if (isset($geschoss[$value['id']])) { $arr[$key]['geschoss'] = implode(",", $geschoss[$value['id']]); } } } return $arr; } }