|
|
@@ -139,16 +139,20 @@ class PointVente extends \yii\db\ActiveRecord |
|
|
|
{ |
|
|
|
PointVenteUser::deleteAll(['id_point_vente' => $this->id]) ; |
|
|
|
|
|
|
|
foreach($this->users as $key => $val) |
|
|
|
if(is_array($this->users) && count($this->users)) |
|
|
|
{ |
|
|
|
$user = User::findOne($val) ; |
|
|
|
if($user) |
|
|
|
foreach($this->users as $key => $val) |
|
|
|
{ |
|
|
|
$point_vente_user = new PointVenteUser ; |
|
|
|
$point_vente_user->id_user = $val ; |
|
|
|
$point_vente_user->id_point_vente = $this->id ; |
|
|
|
$point_vente_user->save() ; |
|
|
|
$user = User::findOne($val) ; |
|
|
|
if($user) |
|
|
|
{ |
|
|
|
$point_vente_user = new PointVenteUser ; |
|
|
|
$point_vente_user->id_user = $val ; |
|
|
|
$point_vente_user->id_point_vente = $this->id ; |
|
|
|
$point_vente_user->save() ; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |