diff options
author | Yorhel <git@yorhel.nl> | 2009-11-27 14:48:20 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-11-27 14:52:20 +0100 |
commit | 9613533da2c58af3c64e3bd4ed7b92b22ffd442f (patch) | |
tree | 425ee689a98a555638431f92d1bc76cbef22eedd /lib/VNDB/Handler/ULists.pm | |
parent | 542c1e22daf2648b3babce2ab2050120eec0a9b9 (diff) |
DB: Abstracted all ORDER BY clauses in the DB abstraction layer
The ORDER BY was previously specified using an 'order' argument, which
would then be directly inserted into the query. The new method is the
same as what I used for the public API: two 'sort' and 'reverse'
arguments. This should be less error-prone and more readable.
This changes quite a lot of code, so I hope I haven't forgotten to
update something along the way.
Diffstat (limited to 'lib/VNDB/Handler/ULists.pm')
-rw-r--r-- | lib/VNDB/Handler/ULists.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm index 6a0d6c9e..9d6885ad 100644 --- a/lib/VNDB/Handler/ULists.pm +++ b/lib/VNDB/Handler/ULists.pm @@ -122,7 +122,7 @@ sub wishlist { my($list, $np) = $self->dbWishListGet( uid => $uid, - order => $f->{s}.' '.($f->{o} eq 'a' ? ($f->{s} eq 'wstat' ? 'DESC' : 'ASC' ) : ($f->{s} eq 'wstat' ? 'ASC' : 'DESC')).($f->{s} eq 'wstat' ? ', title ASC' : ''), + sort => $f->{s}, reverse => $f->{o} eq 'd', $f->{f} != -1 ? (wstat => $f->{f}) : (), what => 'vn', results => 50, @@ -229,7 +229,7 @@ sub vnlist { uid => $uid, results => 50, page => $f->{p}, - order => $f->{s}.' '.($f->{o} eq 'd' ? 'DESC' : 'ASC').($f->{s} eq 'vote' ? ', title ASC' : ''), + sort => $f->{s}, reverse => $f->{o} eq 'd', voted => $f->{v}, $f->{c} ne 'all' ? (char => $f->{c}) : (), ); |