Skip to content

Commit

Permalink
Update BookSearch.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ufaboy committed Oct 23, 2023
1 parent 1fb7bb8 commit 278b5ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/api/models/BookSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ public function search($params) {
'between', 'book.text_length', $sizeStart, $sizeLast
]);

$query->groupBy(['book.id', 'author.name', 'series.name', 'tag.name']);
$query->groupBy(['book.id', 'author.name', 'series.name']);
$dataProvider->sort->attributes['text_length'] = [
'asc' => ['text_length' => SORT_ASC, 'book.id' => SORT_ASC],
'desc' => ['text_length' => SORT_DESC, 'book.id' => SORT_DESC],
];
$dataProvider->sort->attributes['tags'] = [
'asc' => [Tag::tableName() . '.name' => SORT_ASC, 'book.id' => SORT_ASC],
'desc' => [Tag::tableName() . '.name' => SORT_DESC, 'book.id' => SORT_DESC],
];
// $dataProvider->sort->attributes['tags'] = [
// 'asc' => [Tag::tableName() . '.name' => SORT_ASC, 'book.id' => SORT_ASC],
// 'desc' => [Tag::tableName() . '.name' => SORT_DESC, 'book.id' => SORT_DESC],
// ];
$dataProvider->sort->attributes['author'] = [
'asc' => ['author.name' => SORT_ASC, 'book.id' => SORT_ASC],
'desc' => ['author.name' => SORT_DESC, 'book.id' => SORT_DESC],
Expand Down

0 comments on commit 278b5ae

Please sign in to comment.