Bläddra i källkod

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

refactoring
Guillaume Bourgeois 6 år sedan
förälder
incheckning
bf75fd95b7
1 ändrade filer med 12 tillägg och 13 borttagningar
  1. +12
    -13
      backend/controllers/SiteController.php

+ 12
- 13
backend/controllers/SiteController.php Visa fil

@@ -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();

Laddar…
Avbryt
Spara