Browse Source

[backend] Abonnements : ordre produits

refactoring
Guillaume Bourgeois 5 years ago
parent
commit
ac3585532f
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      backend/controllers/SubscriptionController.php

+ 7
- 3
backend/controllers/SubscriptionController.php View File

@@ -117,7 +117,9 @@ class SubscriptionController extends BackendController
}
// produits
$productsArray = Product::searchAll() ;
$productsArray = Product::searchAll([], [
'orderby' => 'product.order ASC'
]) ;
if ($model->load(Yii::$app->request->post()) && $model->validate()
&& $model->save())
@@ -191,7 +193,9 @@ class SubscriptionController extends BackendController
}

// produits
$productsArray = Product::searchAll() ;
$productsArray = Product::searchAll([], [
'orderby' => 'product.order ASC'
]) ;

if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if (!strlen($model->date_end)) {
@@ -270,7 +274,7 @@ class SubscriptionController extends BackendController
}]) ;
}
$productsArray = $productsQuery->asArray()->all() ;
$productsArray = $productsQuery->asArray()->orderBy('order ASC')->all() ;
foreach($productsArray as &$theProduct) {
$theProduct['unit_save'] = $theProduct['unit'] ;

Loading…
Cancel
Save