瀏覽代碼

Merge branch 'dev'

prodstable
Guillaume 2 年之前
父節點
當前提交
dd5a77caed
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. +5
    -3
      backend/controllers/DistributionController.php
  2. +1
    -0
      backend/web/js/vuejs/distribution-index.js

+ 5
- 3
backend/controllers/DistributionController.php 查看文件

@@ -400,10 +400,11 @@ class DistributionController extends BackendController
];
}

public function actionAjaxUpdateProductOrder($idUser = false, $idPointSale = false)
public function actionAjaxUpdateProductOrder($idDistribution, $idUser = false, $idPointSale = false)
{
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;

$distribution = Distribution::findOne($idDistribution) ;
$user = User::findOne($idUser) ;
$userProducer = UserProducer::searchOne([
'id_user' => $idUser,
@@ -414,8 +415,9 @@ class DistributionController extends BackendController
->where([
'id_producer' => GlobalParam::getCurrentProducerId(),
'product.active' => 1,
])->joinWith(['productPrice'])
->all();
])->joinWith(['productPrice', 'productDistribution' => function ($q) use ($distribution) {
$q->where(['id_distribution' => $distribution->id]);
}])->all();

$productOrderArray = [];
foreach ($productsArray as $product) {

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

@@ -589,6 +589,7 @@ var app = new Vue({
if(order) {
axios.get(UrlManager.getBaseUrlAbsolute() + "distribution/ajax-update-product-order", {
params: {
idDistribution: app.distribution.id,
idUser: order.id_user,
idPointSale: order.id_point_sale
}

Loading…
取消
儲存