Quellcode durchsuchen

Merge branch 'feature/backend/divers_tableau_bord' into dev

refactoring
Guillaume Bourgeois vor 6 Jahren
Ursprung
Commit
eb71973fda
2 geänderte Dateien mit 14 neuen und 16 gelöschten Zeilen
  1. +12
    -13
      backend/controllers/SiteController.php
  2. +2
    -3
      backend/views/site/index.php

+ 12
- 13
backend/controllers/SiteController.php Datei anzeigen

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

+ 2
- 3
backend/views/site/index.php Datei anzeigen

@@ -137,7 +137,6 @@ $this->title = 'Tableau de bord';
</div>
<div class="panel-body">
<?php if(count($clients_credit_pain_negatif)): ?>
<p>Dernières inscriptions :</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
@@ -277,9 +276,9 @@ $this->title = 'Tableau de bord';
<thead>
<tr>
<th></th>
<th>Historique</th>
<th>Date</th>
<th>Client</th>
<th>Historique</th>
<th>Produits</th>
<th>Point de vente</th>
<th>Montant</th>
@@ -289,7 +288,6 @@ $this->title = 'Tableau de bord';
<?php foreach($commandes as $c): ?>
<tr class="<?= $c->getClassHistorique() ; ?>">
<td class="infos"><?= $c->getStrType(true); ?></td>
<td class="historique"><?= $c->getStrHistorique() ; ?></td>
<td class="date">
<div class="bloc-date">
<div class="jour"><?= strftime('%A', strtotime($c->production->date)) ?></div>
@@ -300,6 +298,7 @@ $this->title = 'Tableau de bord';
<td>
<?= $c->getStrUser(); ?><br />
</td>
<td class="historique"><?= $c->getStrHistorique() ; ?></td>
<td><?= $c->getResumePanier() ; ?></td>
<td><?= $c->getResumePointVente() ; ?></td>
<td><?= $c->getStrMontant() ; ?></td>

Laden…
Abbrechen
Speichern