|
|
@@ -12,6 +12,7 @@ use yii\filters\VerbFilter; |
|
|
|
use common\models\Commande; |
|
|
|
use common\models\CommandeProduit; |
|
|
|
use common\models\PointVente; |
|
|
|
use common\models\PointVenteUser; |
|
|
|
use common\models\Produit; |
|
|
|
use common\helpers\CSV; |
|
|
|
use common\models\User; |
|
|
@@ -1011,6 +1012,15 @@ class CommandeController extends BackendController { |
|
|
|
if($id_user) |
|
|
|
{ |
|
|
|
$commande->id_user = $id_user ; |
|
|
|
|
|
|
|
// commentaire du point de vente |
|
|
|
$point_vente_user = PointVenteUser::find() |
|
|
|
->where(['id_point_vente' => $id_pv, 'id_user' => $id_user]) |
|
|
|
->one() ; |
|
|
|
|
|
|
|
if($point_vente_user && strlen($point_vente_user->commentaire)) { |
|
|
|
$commande->commentaire_point_vente = $point_vente_user->commentaire ; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
$commande->username = $username ; |