309,6 → 309,10 |
return $str; |
} |
|
private function normaliserMotCle($mot_cle) { |
return mb_strtolower($this->supprimerAccents(trim($mot_cle))); |
} |
|
private function obtenirIdDepartement($nomDpt) { |
|
$nomDpt = $this->supprimerAccents($nomDpt); |
355,16 → 359,23 |
$mots_cles = explode(' ', $valeurMasque); |
$requeteMotsClesImg = array(); |
$requeteMotsClesObs = array(); |
$requeteMotsClesImgPublic = array(); |
|
foreach($mots_cles as $mot_cle) { |
//TODO: rechercher sur les mots clés normalisés dans tous les cas ? |
$requeteMotsCles = $this->proteger('%'.$mot_cle.'%'); |
$motsCleProtege = $this->proteger($this->normaliserMotCle('%'.$mot_cle.'%')); |
$requeteMotsClesImgPublic[] = 'di.id_image IN (SELECT ce_image FROM del_image_tag WHERE tag_normalise LIKE '.$motsCleProtege.' AND actif = 1)'; |
$requeteMotsClesImg[] = 'di.mots_cles_texte LIKE '.$requeteMotsCles; |
$requeteMotsClesObs[] = 'dob.mots_cles_texte LIKE '.$requeteMotsCles; |
} |
|
$requeteMotsClesImgPublic = implode(' AND ', $requeteMotsClesImgPublic); |
$requeteMotsClesImg = implode(' AND ', $requeteMotsClesImg); |
$requeteMotsClesObs = implode(' AND ', $requeteMotsClesObs); |
|
$masque = '('. |
'('.$requeteMotsClesImgPublic.') OR '. |
'('.$requeteMotsClesImg.') OR '. |
'('.$requeteMotsClesObs.') '. |
')'; |
401,7 → 412,7 |
'ON doi.id_image = di.id_image '. |
'INNER JOIN del_observation dob '. |
'ON doi.id_observation = dob.id_observation '. |
'INNER JOIN del_utilisateur du '. |
'LEFT JOIN del_utilisateur du '. |
'ON du.id_utilisateur = di.ce_utilisateur '. |
($this->doitJoindreTableTags() ? |
'LEFT JOIN del_image_tag dtag '. |
416,7 → 427,7 |
$requeteLiaisons .= $this->chargerClauseWhere(); |
$requeteLiaisons .= $this->getTri(); |
$requeteLiaisons .= $this->gestionBdd->getLimitSql(); |
//echo $requeteLiaisons;exit; |
|
return $this->bdd->recupererTous($requeteLiaisons); |
} |
|