瀏覽代碼

Point de vente : bug sauvagarde sans accès restreint

master
keun 8 年之前
父節點
當前提交
76433d2938
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. +11
    -7
      common/models/PointVente.php

+ 11
- 7
common/models/PointVente.php 查看文件

@@ -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…
取消
儲存