Browse Source

Liste utilisateurs : bug id user

master
keun 8 years ago
parent
commit
82519c3c8d
2 changed files with 8 additions and 3 deletions
  1. +1
    -1
      backend/controllers/UserController.php
  2. +7
    -2
      backend/views/user/index.php

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

@@ -69,7 +69,7 @@ class UserController extends BackendController
$params = Yii::$app->request->queryParams;
$query = (new \yii\db\Query())
->select('*')
->select('user.id AS user_id, *')
->from('user, user_etablissement')
->where('user.id = user_etablissement.id_user')
->andWhere('user_etablissement.actif = 1')

+ 7
- 2
backend/views/user/index.php View File

@@ -84,8 +84,13 @@ $this->params['breadcrumbs'][] = $this->title;
'headerOptions' => ['class' => 'actions'],
'buttons' => [
'commandes' => function ($url, $model) {
$url = Yii::$app->urlManager->createUrl(['user/commandes','id' => $model['id']]) ;
$count_commandes = Commande::find()->joinWith('production')->where(['id_user' => $model['id'], 'production.id_etablissement' => Yii::$app->user->identity->id_etablissement])->count() ;
$url = Yii::$app->urlManager->createUrl(['user/commandes','id' => $model['user_id']]) ;
$count_commandes = Commande::find()
->joinWith('production')
->where([
'id_user' => $model['user_id'],
'production.id_etablissement' => Yii::$app->user->identity->id_etablissement])
->count() ;
$html = '' ;
if($count_commandes)
{

Loading…
Cancel
Save