Ver código fonte

Liste utilisateurs : bug id user

prodstable
keun 7 anos atrás
pai
commit
82519c3c8d
2 arquivos alterados com 8 adições e 3 exclusões
  1. +1
    -1
      backend/controllers/UserController.php
  2. +7
    -2
      backend/views/user/index.php

+ 1
- 1
backend/controllers/UserController.php Ver arquivo

@@ -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 Ver arquivo

@@ -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)
{

Carregando…
Cancelar
Salvar