Line 54... |
Line 54... |
54 |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cs_id_structure, cs_ville, cs_nom, '.
|
54 |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cs_id_structure, cs_ville, cs_nom, '.
|
55 |
' cc_id_collection, cc_nom '.
|
55 |
' cc_id_collection, cc_nom '.
|
56 |
$this->construireFromEtWhere($p).
|
56 |
$this->construireFromEtWhere($p).
|
57 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_ville ASC, cs_nom ASC, cc_nom ASC').' '.
|
57 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_ville ASC, cs_nom ASC, cc_nom ASC').' '.
|
58 |
"LIMIT $this->start, $this->limit ";
|
58 |
"LIMIT $this->start, $this->limit ";
|
59 |
$this->debug[] = $requete;
|
- |
|
- |
|
59 |
|
60 |
// Récupération des résultats
|
60 |
// Récupération des résultats
|
61 |
try {
|
61 |
try {
|
62 |
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
|
62 |
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
|
63 |
if ($donnees === false) {
|
63 |
if ($donnees === false) {
|
64 |
$this->messages[] = "La requête a retourné aucun résultat.";
|
64 |
$this->messages[] = "La requête a retourné aucun résultat.";
|
Line 84... |
Line 84... |
84 |
|
84 |
|
85 |
// Pré traitement des paramêtres
|
85 |
// Pré traitement des paramêtres
|
Line 86... |
Line 86... |
86 |
$p = $this->pretraiterParametresUrl($param);
|
86 |
$p = $this->pretraiterParametresUrl($param);
|
- |
|
87 |
|
87 |
|
88 |
// Construction de la requête
|
88 |
// Construction de la requête
|
89 |
// Il est important de compter le nombre d'association structure-collection différentes pour obtenir le bon nombre
|
89 |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' COUNT(cc_id_collection) AS nbre '.
|
90 |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' COUNT(cs_id_structure) AS nbre, cc_id_collection '.
|
Line 90... |
Line 91... |
90 |
$this->construireFromEtWhere($p).
|
91 |
$this->construireFromEtWhere($p).
|
91 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_ville ASC, cs_nom ASC').' ';
|
92 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_ville ASC, cs_nom ASC').' ';
|