Browse Source

Point de vente : bug sauvagarde sans accès restreint

prodstable
keun 8 years ago
parent
commit
76433d2938
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      common/models/PointVente.php

+ 11
- 7
common/models/PointVente.php View File

@@ -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() ;
}
}
}
}
}

Loading…
Cancel
Save