frontend/controllers/setting/UserController.php
/**
     * Lists all User models.
     * @return mixed
     */
Lists all User models.
@return mixed
Lists all User models . @return mixed
public function actionIndex()
    {
        $searchModel = new UserSearch();
        if(Yii::$app->user->can('director')){
            $searchModel->space_id = Space::find()->where(['company_id' => User::findOne(\Yii::$app->user->getId())->company_id])->one()->id;
        }
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
public function actionIndex ( ) { $ searchModel = new UserSearch ( ) ; if ( Yii :: $ app -> user -> can ( 'director' ) ) { $ searchModel -> space_id = Space :: find ( ) -> where ( [ 'company_id' => User :: findOne ( \ Yii :: $ app -> user -> getId ( ) ) -> company_id ] ) -> one ( ) -> id ; } $ dataProvider = $ searchModel -> search ( Yii :: $ app -> request -> queryParams ) ; return $ this -> render ( 'index' , [ 'searchModel' => $ searchModel , 'dataProvider' => $ dataProvider , ] ) ; }
Lists all User models.
Lists all User models .