浏览代码

Liste utilisateurs : bug id user

master
keun 7 年前
父节点
当前提交
82519c3c8d
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. +1
    -1
      backend/controllers/UserController.php
  2. +7
    -2
      backend/views/user/index.php

+ 1
- 1
backend/controllers/UserController.php 查看文件

@@ -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 查看文件

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

正在加载...
取消
保存