Added ordering of results by date, name

This commit is contained in:
Noikoio 2018-02-10 19:05:18 -08:00
parent 4208b84dbe
commit e9a4e3e726

View file

@ -212,7 +212,8 @@ namespace Noikoio.RegexBot.EntityCache
using (var c = db.CreateCommand())
{
c.CommandText = $"SELECT {QueryColumns} FROM {SqlHelper.TableUser} WHERE "
+ "( lower(username) = lower(@NameSearch) OR lower(nickname) = lower(@NameSearch) )";
+ "( lower(username) = lower(@NameSearch) OR lower(nickname) = lower(@NameSearch) ) "
+ "ORDER BY cache_date desc, username";
c.Parameters.Add("@NameSearch", NpgsqlTypes.NpgsqlDbType.Text).Value = name;
if (disc != null)
{