Add default wish order
This commit is contained in:
parent
9580983bf2
commit
964d0fa1a1
1 changed files with 6 additions and 4 deletions
|
@ -56,14 +56,16 @@ class Wishlist
|
||||||
{
|
{
|
||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
$SELECT = isset($sql['SELECT']) ? $sql['SELECT'] : '*';
|
$SELECT = isset($sql['SELECT']) ? $sql['SELECT'] : '*';
|
||||||
$FROM = isset($sql['FROM']) ? $sql['FROM'] : '`wishes`';
|
$FROM = isset($sql['FROM']) ? $sql['FROM'] : '`wishes`';
|
||||||
$WHERE = isset($sql['WHERE']) ? $sql['WHERE'] : '`wishlist` = ' . $this->id;
|
$WHERE = isset($sql['WHERE']) ? $sql['WHERE'] : '`wishlist` = ' . $this->id;
|
||||||
|
$ORDER_BY = isset($sql['ORDER_BY']) ? $sql['ORDER_BY'] : '`priority` DESC, `title` ASC, `url` ASC';
|
||||||
|
|
||||||
$this->wishes = $database
|
$this->wishes = $database
|
||||||
->query('SELECT ' . $SELECT . '
|
->query('SELECT ' . $SELECT . '
|
||||||
FROM ' . $FROM . '
|
FROM ' . $FROM . '
|
||||||
WHERE ' . $WHERE . ';')
|
WHERE ' . $WHERE . '
|
||||||
|
ORDER BY ' . $ORDER_BY . ';')
|
||||||
->fetchAll();
|
->fetchAll();
|
||||||
|
|
||||||
foreach ($this->wishes as &$wish) {
|
foreach ($this->wishes as &$wish) {
|
||||||
|
|
Loading…
Reference in a new issue