Selaa lähdekoodia

Liste utilisateurs : bug id user

prodstable
keun 7 vuotta sitten
vanhempi
commit
82519c3c8d
2 muutettua tiedostoa jossa 8 lisäystä ja 3 poistoa
  1. +1
    -1
      backend/controllers/UserController.php
  2. +7
    -2
      backend/views/user/index.php

+ 1
- 1
backend/controllers/UserController.php Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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…
Peruuta
Tallenna