Pārlūkot izejas kodu

[Backend] Abonnements : correctif prix

refactoring
Guillaume pirms 2 gadiem
vecāks
revīzija
503c48fc92
1 mainītis faili ar 10 papildinājumiem un 4 dzēšanām
  1. +10
    -4
      common/models/Subscription.php

+ 10
- 4
common/models/Subscription.php Parādīt failu

@@ -39,14 +39,14 @@
namespace common\models;

use common\helpers\GlobalParam;
use common\models\PointSale;
use common\models\User;
use Yii;
use common\components\ActiveRecordCommon;
use common\models\Producer;
use common\models\PointSale;
use common\models\UserPointSale;
use common\models\Order;
use common\models\ProductOrder;
use common\models\User;

/**
* This is the model class for table "commande_auto".
@@ -187,6 +187,12 @@ class Subscription extends ActiveRecordCommon
} else {
$order->id_user = $this->id_user;
}

$user = false;
if($this->id_user) {
$user = User::findOne($this->id_user);
}

$order->date = date('Y-m-d H:i:s');
$order->origin = Order::ORIGIN_AUTO;
$order->id_point_sale = $this->id_point_sale;
@@ -248,8 +254,8 @@ class Subscription extends ActiveRecordCommon
$productOrder->id_product = $productSubscription->product->id;
$productOrder->quantity = $productSubscription->quantity;
$productOrder->price = $productSubscription->product->getPrice([
'id_user' => $this->id_user,
'id_point_sale' => $this->id_point_sale
'user' => $user,
'point_sale' => $pointSale
]);
$productOrder->unit = $productSubscription->product->unit;
$productOrder->step = $productSubscription->product->step;

Notiek ielāde…
Atcelt
Saglabāt