瀏覽代碼

[Administration] Distributions : correctif mise à jour quantités max

feature/rotating_product
Guillaume Bourgeois 4 月之前
父節點
當前提交
7b7d7451c6
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. +7
    -1
      backend/controllers/DistributionController.php
  2. +1
    -0
      backend/web/js/vuejs/distribution-index.js

+ 7
- 1
backend/controllers/DistributionController.php 查看文件

@@ -670,11 +670,17 @@ class DistributionController extends BackendController
public function actionAjaxProcessProductQuantityMax($idDistribution, $idProduct, $quantityMax)
{
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$orderModule = $this->getOrderModule();
$productDistributionModule = $this->getProductDistributionModule();
$productDistribution = $this->getProductDistribution($idProduct, $idDistribution);
$productDistributionModule->updateProductDistributionQuantityMax($productDistribution, (float) $quantityMax);
return [
'quantity_remaining' => $this->getOrderModule()->getResolver()
'quantity_max' => $orderModule->getResolver()
->getProductQuantityMax(
$productDistribution->product,
$productDistribution->distribution
),
'quantity_remaining' => $orderModule->getResolver()
->getProductQuantityRemaining(
$productDistribution->product,
$productDistribution->distribution

+ 1
- 0
backend/web/js/vuejs/distribution-index.js 查看文件

@@ -360,6 +360,7 @@ if($(selector).length) {
}
})
.then(function (response) {
Vue.set(app.products[app.getProductIndex(idProduct)], 'quantity_max', response.data.quantity_max);
Vue.set(app.products[app.getProductIndex(idProduct)], 'quantity_remaining', response.data.quantity_remaining);
});
},

Loading…
取消
儲存