Procházet zdrojové kódy

Produits : remise en place order dans la liste

refactoring
Guillaume Bourgeois před 5 roky
rodič
revize
26f59a8cf0
3 změnil soubory, kde provedl 8 přidání a 3 odebrání
  1. +3
    -2
      backend/controllers/ProductController.php
  2. +4
    -1
      backend/web/js/lechatdesnoisettes.js
  3. +1
    -0
      common/models/ProductSearch.php

+ 3
- 2
backend/controllers/ProductController.php Zobrazit soubor

@@ -190,10 +190,11 @@ class ProductController extends BackendController
*
* @param array $array
*/
public function actionOrder($array)
public function actionOrder()
{
$array = Yii::$app->request->post('array') ;
$orderArray = json_decode(stripslashes($array));
foreach($orderArray as $id => $order) {
$product = $this->findModel($id);
$product->order = $order;

+ 4
- 1
backend/web/js/lechatdesnoisettes.js Zobrazit soubor

@@ -646,7 +646,10 @@ function chat_ordre_produits() {
}) ;
console.log(tab_ordre) ;
$.get(UrlManager.getBaseUrl()+'product/order',{
/*$.get(UrlManager.getBaseUrl()+'product/order',{
array: JSON.stringify(tab_ordre)
}) ;*/
$.post(UrlManager.getBaseUrl()+'product/order',{
array: JSON.stringify(tab_ordre)
}) ;
}

+ 1
- 0
common/models/ProductSearch.php Zobrazit soubor

@@ -62,6 +62,7 @@ class ProductSearch extends Product
->with($optionsSearch['with'])
->innerJoinWith($optionsSearch['join_with'], true)
->where(['product.id_producer' => Producer::getId()])
->orderBy('product.order ASC')
;
$dataProvider = new ActiveDataProvider([

Načítá se…
Zrušit
Uložit