mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Allow admin to view collection metadata
This commit is contained in:
parent
bcc2f331bc
commit
23b5c8ef31
8 changed files with 82 additions and 55 deletions
|
@ -2020,17 +2020,17 @@ class Ebook{
|
|||
* Queries for books in a collection.
|
||||
*
|
||||
* Puts ebooks without a `SequenceNumber` at the end of the list, which is more common in a collection with both published and placeholder ebooks.
|
||||
*
|
||||
* @return array<Ebook>
|
||||
*/
|
||||
public static function GetAllByCollection(string $collection): array{
|
||||
public static function GetAllByCollection(int $collectionId): array{
|
||||
$ebooks = Db::Query('
|
||||
SELECT e.*
|
||||
from Ebooks e
|
||||
inner join CollectionEbooks ce using (EbookId)
|
||||
inner join Collections c using (CollectionId)
|
||||
where c.UrlName = ?
|
||||
where ce.CollectionId = ?
|
||||
order by ce.SequenceNumber is null, ce.SequenceNumber, e.EbookCreated desc
|
||||
', [$collection], Ebook::class);
|
||||
', [$collectionId], Ebook::class);
|
||||
|
||||
return $ebooks;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue