Browse Source

Merge branch 'develop'

master^2
Guillaume 3 years ago
parent
commit
14cb988525
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      ShopBundle/Controller/Backend/AdminController.php

+ 12
- 3
ShopBundle/Controller/Backend/AdminController.php View File

@@ -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;
}


Loading…
Cancel
Save