Fix book default sort.

This commit is contained in:
Tyler J. Wagner 2013-01-25 20:27:38 +01:00
parent 34ace66580
commit cb1d622220

View file

@ -19,7 +19,7 @@ define ('SQL_BOOKS_LEFT_JOIN', "left outer join comments on comments.book = book
left outer join books_ratings_link on books_ratings_link.book = books.id left outer join books_ratings_link on books_ratings_link.book = books.id
left outer join ratings on books_ratings_link.rating = ratings.id "); left outer join ratings on books_ratings_link.rating = ratings.id ");
define ('SQL_BOOKS_BY_FIRST_LETTER', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_BY_FIRST_LETTER', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where upper (books.sort) like ?"); where upper (books.sort) like ? order by books.sort");
define ('SQL_BOOKS_BY_AUTHOR', "select {0} from books_authors_link, books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_BY_AUTHOR', "select {0} from books_authors_link, books " . SQL_BOOKS_LEFT_JOIN . "
where books_authors_link.book = books.id and author = ? {1} order by pubdate"); where books_authors_link.book = books.id and author = ? {1} order by pubdate");
define ('SQL_BOOKS_BY_SERIE', "select {0} from books_series_link, books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_BY_SERIE', "select {0} from books_series_link, books " . SQL_BOOKS_LEFT_JOIN . "
@ -29,7 +29,7 @@ define ('SQL_BOOKS_BY_TAG', "select {0} from books_tags_link, books " . SQL_BOOK
define ('SQL_BOOKS_BY_CUSTOM', "select {0} from {2}, books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_BY_CUSTOM', "select {0} from {2}, books " . SQL_BOOKS_LEFT_JOIN . "
where {2}.book = books.id and {2}.{3} = ? {1} order by sort"); where {2}.book = books.id and {2}.{3} = ? {1} order by sort");
define ('SQL_BOOKS_QUERY', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_QUERY', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where (exists (select null from authors, books_authors_link where book = books.id and author = authors.id and authors.name like ?) or title like ?) {1}"); where (exists (select null from authors, books_authors_link where book = books.id and author = authors.id and authors.name like ?) or title like ?) {1} order by books.sort");
define ('SQL_BOOKS_RECENT', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " define ('SQL_BOOKS_RECENT', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where 1=1 {1} order by timestamp desc limit "); where 1=1 {1} order by timestamp desc limit ");