Pārlūkot izejas kodu

[Backend] Distribution > ajout commande : produit actif / inactif

refactoring
Guillaume pirms 2 gadiem
vecāks
revīzija
3acd8aa3b6
2 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. +5
    -3
      backend/controllers/DistributionController.php
  2. +1
    -0
      backend/web/js/vuejs/distribution-index.js

+ 5
- 3
backend/controllers/DistributionController.php Parādīt failu

@@ -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 Parādīt failu

@@ -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
}

Notiek ielāde…
Atcelt
Saglabāt