commit
8242e91238
2 changed files with 3 additions and 1 deletions
|
@ -105,7 +105,7 @@ class UiWebsocketPlugin(object):
|
||||||
for name, query in feeds.iteritems():
|
for name, query in feeds.iteritems():
|
||||||
try:
|
try:
|
||||||
db_query = DbQuery(query)
|
db_query = DbQuery(query)
|
||||||
db_query.wheres.append("%s LIKE ? OR %s LIKE ?" % (db_query.fields["body"], db_query.fields["title"]))
|
db_query.wheres.append("(%s LIKE ? OR %s LIKE ?)" % (db_query.fields["body"], db_query.fields["title"]))
|
||||||
db_query.parts["ORDER BY"] = "date_added DESC"
|
db_query.parts["ORDER BY"] = "date_added DESC"
|
||||||
db_query.parts["LIMIT"] = "30"
|
db_query.parts["LIMIT"] = "30"
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ class DbQuery:
|
||||||
def parseWheres(self, query_where):
|
def parseWheres(self, query_where):
|
||||||
if " AND " in query_where:
|
if " AND " in query_where:
|
||||||
return query_where.split(" AND ")
|
return query_where.split(" AND ")
|
||||||
|
elif query_where:
|
||||||
|
return [query_where]
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue