Quellcode durchsuchen

[Backend] Ordre de tri et affichage des commandes du midi

develop
Fab vor 3 Jahren
Ursprung
Commit
0710c081c8
1 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen
  1. +12
    -3
      ShopBundle/Controller/Backend/AdminController.php

+ 12
- 3
ShopBundle/Controller/Backend/AdminController.php Datei anzeigen

@@ -136,11 +136,15 @@ class AdminController extends EasyAdminController
$dqlFilter = sprintf(str_replace('currentMerchant', $this->getUser()->getMerchant()->getId(), $dqlFilter));
}

if ($pos = strpos($dqlFilter, 'NOW()')) {
if ($pos = strpos($dqlFilter, 'TODAYSTART')) {
$date = new \DateTime();
$dqlFilter = sprintf(str_replace('NOW()', $date->format('Y-m-d H:i:s'), $dqlFilter));

$dqlFilter = sprintf(str_replace('TODAYSTART', $date->format('Y-m-d').' 00:00:00', $dqlFilter));
}
if ($pos = strpos($dqlFilter, 'TODAYEND')) {
$date = new \DateTime();
$dqlFilter = sprintf(str_replace('TODAYEND', $date->format('Y-m-d').' 23:59:59', $dqlFilter));
}

if ($pos = strpos($dqlFilter, 'sectionLunch')) {
$dqlFilter = sprintf(str_replace('sectionLunch', $this->sectionUtils->getSection('lunch')->getId(), $dqlFilter));
} else if ($pos = strpos($dqlFilter, 'sectionMarket')) {
@@ -238,6 +242,11 @@ class AdminController extends EasyAdminController
}
}

//TODO déplacer dans LC
if($this->entity['name']== 'OrderShopLunch' || $this->entity['name']== 'OrderShopLunchDay'){
$queryBuilder->addOrderBy('entity.user', 'asc');
}

return $queryBuilder;
}


Laden…
Abbrechen
Speichern