瀏覽代碼

Merge branch 'develop'

master
Guillaume Bourgeois 4 月之前
父節點
當前提交
345e120f8d
共有 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…
取消
儲存