Procházet zdrojové kódy

Afficher toutes les commandes clients (incluant les commandes 'auto' modifiées ou supprimées par le client)

refactoring
Guillaume Bourgeois před 6 roky
rodič
revize
bf75fd95b7
1 změnil soubory, kde provedl 12 přidání a 13 odebrání
  1. +12
    -13
      backend/controllers/SiteController.php

+ 12
- 13
backend/controllers/SiteController.php Zobrazit soubor

@@ -109,22 +109,21 @@ class SiteController extends BackendController {
public function actionIndex() {
// commandes
$productions = Production::find()
->with('commande')
->where(['>=', 'production.date', date('Y-m-d')])
->andWhere([
'production.id_etablissement' => Yii::$app->user->identity->id_etablissement,
'production.actif' => 1
])
->orderBy('date ASC')
->limit(5)
->all();
->with('commande')
->where(['>=', 'production.date', date('Y-m-d')])
->andWhere([
'production.id_etablissement' => Yii::$app->user->identity->id_etablissement,
'production.actif' => 1
])
->orderBy('date ASC')
->limit(5)
->all();

// dernières commandes
$commandes = Commande::findBy([
'orderby' => 'date DESC',
'limit' => 15,
'condition' => 'production.date > \'' . date('Y-m-d 00:00:00') . '\' AND (type = \'' . Commande::TYPE_USER . '\' OR type = \'' . Commande::TYPE_ADMIN . '\')'
]);
'orderby' => 'date DESC',
'condition' => 'production.date > \'' . date('Y-m-d 00:00:00') . '\' AND (type = \'' . Commande::TYPE_USER . '\' OR type = \'' . Commande::TYPE_ADMIN . '\' OR (type = \'' . Commande::TYPE_AUTO . '\' AND (date_update IS NOT NULL OR date_delete IS NOT NULL)))'
]);

foreach ($commandes as $c)
$c->init();

Načítá se…
Zrušit
Uložit