瀏覽代碼

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

refactoring
Guillaume Bourgeois 6 年之前
父節點
當前提交
bf75fd95b7
共有 1 個檔案被更改,包括 12 行新增13 行删除
  1. +12
    -13
      backend/controllers/SiteController.php

+ 12
- 13
backend/controllers/SiteController.php 查看文件

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

Loading…
取消
儲存