浏览代码

Bug commentaires point de vente non ajouté lors des commandes automatiques

master
keun 7 年前
父节点
当前提交
6a98f41eb2
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      common/models/CommandeAuto.php

+ 10
- 0
common/models/CommandeAuto.php 查看文件

@@ -6,6 +6,7 @@ use Yii;

use common\models\Etablissement ;
use common\models\PointVente ;
use common\models\PointVenteUser ;
use common\models\Commande ;
use common\models\CommandeProduit ;

@@ -188,6 +189,15 @@ class CommandeAuto extends \yii\db\ActiveRecord
$commande->type = Commande::TYPE_AUTO ;
$commande->id_point_vente = $this->id_point_vente ;
$commande->id_production = $production->id ;
$point_vente_user = PointVenteUser::find()
->where(['id_point_vente' => $this->id_point_vente, 'id_user' => $this->id_user])
->one() ;
if($point_vente_user && strlen($point_vente_user->commentaire)) {
$commande->commentaire_point_vente = $point_vente_user->commentaire ;
}
$commande->save() ;
// produits

正在加载...
取消
保存