Skip to content
Extraits de code Groupes Projets
Valider f9cd149e rédigé par esj's avatar esj
Parcourir les fichiers

permettre des exceptions dynamiques pour les tables SQL

parent 4fc82393
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -91,22 +91,19 @@ function index_tables_en_pile($idb, $nom_champ, &$boucles) ...@@ -91,22 +91,19 @@ function index_tables_en_pile($idb, $nom_champ, &$boucles)
$excep = $exceptions_des_tables[$r][$nom_champ]; $excep = $exceptions_des_tables[$r][$nom_champ];
if ($excep) { if ($excep) {
// entite SPIP alias d'un champ SQL // entite SPIP alias d'un champ SQL
if (!is_array($excep)) { if (is_array($excep)) {
$e = $excep; // et meme d'un champ dans une jointure
$c = $excep;
}
// entite SPIP alias d'un champ dans une jointure
else {
if (!$t = array_search($excep[0], $boucles[$idb]->from)) { if (!$t = array_search($excep[0], $boucles[$idb]->from)) {
$t = 'J' . count($boucles[$idb]->from); $t = 'J' . count($boucles[$idb]->from);
$boucles[$idb]->from[$t] = $excep[0]; $boucles[$idb]->from[$t] = $excep[0];
} }
$e = $excep[1]; $excep = $excep[1];
$c = $nom_champ;
if ($e != $nom_champ) $e .= ' AS '.$c;
} }
return array("$t.$e", $c); // demander a SQL de gerer le synonyme
// ca permet que excep soit dynamique (Cedric, 2/3/06)
if ($excep != $nom_champ) $excep .= ' AS '. $nom_champ;
return array("$t.$excep", $nom_champ);
} else { } else {
if ($desc['field'][$nom_champ]) if ($desc['field'][$nom_champ])
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter