Browse Source

[backend] Correction suppression des utilisateurs d'un établissement

La suppression n'était pas prise en compte car on affichait tous les utilisateurs
même s'ils avaient le champs "user_producer.active" à 0.
refactoring
Guillaume Bourgeois 5 years ago
parent
commit
826ea51c2d
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      backend/controllers/UserController.php
  2. +1
    -1
      common/models/UserSearch.php

+ 1
- 0
backend/controllers/UserController.php View File

@@ -267,6 +267,7 @@ class UserController extends BackendController
$userProducer->active = 0 ;
$userProducer->bookmark = 0 ;
$userProducer->save() ;
Yii::$app->getSession()->setFlash('success', 'L\'utilisateur a bien été supprimé de votre établissement.');
}
else {
throw new \yii\web\NotFoundHttpException('L\'enregistrement UserProducer est introuvable', 404) ;

+ 1
- 1
common/models/UserSearch.php View File

@@ -107,7 +107,7 @@ class UserSearch extends User
return $dataProvider;
}
$query->innerJoin('user_producer','user.id = user_producer.id_user AND user_producer.id_producer = :id_producer', [':id_producer' => Producer::getId()]) ;
$query->innerJoin('user_producer','user.id = user_producer.id_user AND user_producer.id_producer = :id_producer AND user_producer.active = 1', [':id_producer' => Producer::getId()]) ;
if(isset($this->id_point_sale) && $this->id_point_sale) {
$pointSale = PointSale::findOne(['id' => $this->id_point_sale]) ;

Loading…
Cancel
Save