mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 08:02:00 +01:00
gui: folder search fix
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
857f5e549d
commit
3feefe973b
@ -196,6 +196,7 @@ class ModelSearchSearch extends Model {
|
|||||||
array_push($search_folders, $v);
|
array_push($search_folders, $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
array_push($search_folders, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,7 +232,8 @@ class ModelSearchSearch extends Model {
|
|||||||
$q1 = "?" . str_repeat(",?", count($f_bag)-1);
|
$q1 = "?" . str_repeat(",?", count($f_bag)-1);
|
||||||
$f_bag = array_merge($f_bag, $search_folders);
|
$f_bag = array_merge($f_bag, $search_folders);
|
||||||
|
|
||||||
$query = $this->db->query("SELECT id FROM " . TABLE_FOLDER_MESSAGE . " WHERE message_id IN ($q1) AND folder_id IN ($q2)", $f_bag);
|
//$query = $this->db->query("SELECT id FROM " . TABLE_FOLDER_MESSAGE . " WHERE message_id IN ($q1) AND folder_id IN ($q2)", $f_bag);
|
||||||
|
$query = $this->db->query("SELECT DISTINCT message_id AS id FROM " . TABLE_FOLDER_MESSAGE . " WHERE message_id IN ($q1) AND folder_id IN ($q2)", $f_bag);
|
||||||
|
|
||||||
if(LOG_LEVEL >= NORMAL) { syslog(LOG_INFO, sprintf("sql query: '%s' in %.2f s, %d hits", $query->query, $query->exec_time, $query->num_rows)); }
|
if(LOG_LEVEL >= NORMAL) { syslog(LOG_INFO, sprintf("sql query: '%s' in %.2f s, %d hits", $query->query, $query->exec_time, $query->num_rows)); }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user