Merge branch '1389-Filtro-de-Tags-dev' into 'develop'

Fixed search by tags

See merge request !912
This commit is contained in:
vgilc 2017-10-10 13:46:29 +02:00
commit 9181d1ca16
1 changed files with 7 additions and 2 deletions

View File

@ -234,8 +234,12 @@ if (!empty($tag_with)) {
$first = true;
$filter_resume['tag_inc'] = $tag_with;
foreach ($tag_with as $id_tag) {
if ($first) $first = false;
else $sql_post .= " AND ";
if ($first){
$sql_post .= " ( ";
$first = false;
} else {
$sql_post .= " AND ( ";
}
$sql_post .= "tags LIKE '" . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '" . tags_get_name($id_tag) . ",%'";
@ -243,6 +247,7 @@ if (!empty($tag_with)) {
$sql_post .= "tags LIKE '%," . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%," . tags_get_name($id_tag) . ",%'";
$sql_post .= ' ) ';
}
$sql_post .= ' ) ';
}