backend/controllers/MenusController.php
/**
     * Lists all Menus models.
     * @return mixed
     */
Lists all Menus models.
@return mixed
Lists all Menus models . @return mixed
public function actionIndex()
    {
        $userId = Yii::$app->user->identity->id;
        $dataProvider = new ActiveDataProvider([
            'query' => Menus::find()->where("restaurantId = (SELECT restaurantId FROM staff WHERE userId = $userId)"),
            'pagination' => [
                'pageSize' => 100,
            ],
        ]);
        return $this->render('index', [
            'dataProvider' => $dataProvider,
        ]);
    }
public function actionIndex ( ) { $ userId = Yii :: $ app -> user -> identity -> id ; $ dataProvider = new ActiveDataProvider ( [ 'query' => Menus :: find ( ) -> where ( " restaurantId = (SELECT restaurantId FROM staff WHERE userId =  $ userId ) " ) , 'pagination' => [ 'pageSize' => 100 , ] , ] ) ; return $ this -> render ( 'index' , [ 'dataProvider' => $ dataProvider , ] ) ; }
Lists all Menus models.
Lists all Menus models .