Kaynağa Gözat

Adapter la page production du backend au système multi-boulangerie

master
keun 8 yıl önce
ebeveyn
işleme
89baa009a6
1 değiştirilmiş dosya ile 13 ekleme ve 3 silme
  1. +13
    -3
      backend/controllers/CommandeController.php

+ 13
- 3
backend/controllers/CommandeController.php Dosyayı Görüntüle

@@ -57,6 +57,7 @@ class CommandeController extends \yii\web\Controller {
->with('commandeProduits', 'user')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->all();

foreach ($commandes as $c)
@@ -135,10 +136,15 @@ class CommandeController extends \yii\web\Controller {
$commandes = [];

// points de vente
$points_vente = PointVente::find()->all();
$points_vente = PointVente::find()
->where(['id_etablissement' => Yii::$app->user->identity->id_etablissement])
->all();

// produits
$produits = Produit::find()->orderBy('order ASC')->all();
$produits = Produit::find()
->where(['id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('order ASC')
->all();

// users
$arr_users = [0 => '--'];
@@ -150,7 +156,10 @@ class CommandeController extends \yii\web\Controller {
// création du jour de production
$production = null;
if ($date != '') {
$production = Production::find()->where(['date' => $date])->one();
$production = Production::find()
->where(['date' => $date])
->andWhere(['id_etablissement'=>Yii::$app->user->identity->id_etablissement])
->one();
if (!$production) {
$production = new Production;
$production->date = $date;
@@ -168,6 +177,7 @@ class CommandeController extends \yii\web\Controller {
->with('commandeProduits', 'user')
->joinWith('production')
->where(['production.date' => $date])
->andWhere(['production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->orderBy('date ASC')
->all();


Yükleniyor…
İptal
Kaydet