Commit 19b3195a authored by Johannes Schwab's avatar Johannes Schwab

client: search finds matching ingredients (not just reipce names)

parent 893757e1
......@@ -278,7 +278,7 @@ void SqlBackend::setOneValueIngredients(const QString &valueName, const T &value
QList<Recipe*> SqlBackend::getRecipes(const QString &filter) {
QSqlQuery query = getQuery();
query.prepare("SELECT id FROM recipes WHERE UPPER(name) LIKE UPPER(:filter) ORDER BY name COLLATE NOCASE;");
query.prepare("SELECT DISTINCT FROM recipes r LEFT JOIN ingredients i ON = i.idRecipe WHERE UPPER( LIKE UPPER(:filter) OR UPPER(i.article) LIKE UPPER(:filter) ORDER BY name COLLATE NOCASE;");
query.bindValue(":filter", QString("%%1%").arg(filter));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment