1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| function getResultSearch($langCode,$motscles, $domaine , $local,$contrat)
{
$chaine= $motscles;
$sc = "
SELECT {$this->alias}.offreId,
{$this->alias}.offreTitre,
{$this->alias}.offreText,
{$this->alias}.langCode,
o.offreActive,
o.offreRemuneration,
ct.contratTitre,
dt.domaineTitre,
lt.localTitre,
o.offreDateModif
FROM {$this->table} {$this->alias}
INNER JOIN recrutement_offre o ON {$this->alias}.offreId = o.offreId
";
if($domaine != '')
{
$join_domaine = "INNER JOIN recrutement_domaine_text dt ON o.domaineId = dt.domaineId ";
$where_domaine = "AND dt.langCode = '{$langCode}' AND o.domaineId = '{$domaine}' ";
}
if($contrat != '')
{
$join_contrat = "INNER JOIN recrutement_contrat_text ct ON o.contratId = ct.contratId ";
$where_contrat = "AND ct.langCode = '{$langCode}' AND o.contratId = '{$contrat}' ";
}
if($local != '')
{
$join_local = "INNER JOIN recrutement_local_text lt ON o.localId = lt.localId ";
$where_local = "AND lt.langCode = '{$langCode}' AND o.localId = '{$local}' "
}
$sc .= $join_domaine . $join_contrat . $join_local ."
LEFT JOIN thermidor_language l ON {$this->alias}.langCode = l.langCode
WHERE {$this->alias}.langCode = '{$langCode}'
AND o.`offreActive` = 1
" . $where_domaine . $where_contrat . $where_local;
if($chaine != '')
{
$sc .= "AND {$this->alias}.offreMotsCles LIKE '%".$chaine."%' ";
}
if($rc = Database::execute_sql($sc))
{
return $this->parseResults($rc);
}
} |
Partager