Skip to content

Commit 14b7ad3

Browse files
committed
Always keep a deterministic order
1 parent 8d5cfa8 commit 14b7ad3

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 = ? ORDER BY isReady DESC", [$userId]);
27+
$results = $this->query("SELECT * FROM ShoppingListDetail WHERE userId = ? ORDER BY isReady DESC, id", [$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 = ? ORDER BY isReady", [$shopId]);
37+
$results = $this->query("SELECT * FROM ShoppingListDetail WHERE shopId = ? ORDER BY isReady, id", [$shopId]);
3838
return $this->groupResultByListId($results);
3939
}
4040

0 commit comments

Comments
 (0)