|
|
@@ -361,11 +361,11 @@ class Commande extends \yii\db\ActiveRecord |
|
|
|
$commandes = Commande::find() |
|
|
|
->with('commandeProduits', 'user', 'creditHistorique', 'pointVente') |
|
|
|
->joinWith('production') |
|
|
|
->andWhere(['production.id_etablissement' => $params['id_etablissement']]) ; |
|
|
|
->where(['production.id_etablissement' => $params['id_etablissement']]) ; |
|
|
|
|
|
|
|
|
|
|
|
if(isset($params['date'])) |
|
|
|
$commandes = $commandes->where(['production.date' => $params['date']]); |
|
|
|
$commandes = $commandes->andWhere(['production.date' => $params['date']]); |
|
|
|
|
|
|
|
if(isset($params['order'])) |
|
|
|
$commandes = $commandes->orderBy('date '.$params['order']); |