Skip to content

Commit 8d5cfa8

Browse files
committed
Set shopping lists order
1 parent 57c492f commit 8d5cfa8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/dao/ShoppingListDao.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ShoppingListDao extends Dao {
2424
* @return array
2525
*/
2626
public function getListsByUserId(int $userId) {
27-
$results = $this->query("SELECT * FROM ShoppingListDetail WHERE userId = ?", [$userId]);
27+
$results = $this->query("SELECT * FROM ShoppingListDetail WHERE userId = ? ORDER BY isReady DESC", [$userId]);
2828
return $this->groupResultByListId($results);
2929
}
3030

@@ -34,7 +34,7 @@ public function getListsByUserId(int $userId) {
3434
* @return array
3535
*/
3636
public function getListsByShopId(int $shopId) {
37-
$results = $this->query("SELECT * FROM ShoppingListDetail WHERE shopId = ?", [$shopId]);
37+
$results = $this->query("SELECT * FROM ShoppingListDetail WHERE shopId = ? ORDER BY isReady", [$shopId]);
3838
return $this->groupResultByListId($results);
3939
}
4040

0 commit comments

Comments
 (0)