src/modules/MyOrder/controllers/OrderController.php
public function actionIndex()
    {
        $searchModel = new OrderSearch();
        $queryParams = request()->queryParams;
        $queryParams['OrderSearch']['customer_username'] = get_current_user_name();
        $dataProvider = $searchModel->search($queryParams);
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        $dataProvider = $searchModel->search(request()->queryParams);

        return $this->render('index', [
            'searchModel'  => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
public function actionIndex()
    {
        $searchModel = new OrderSearch();
        $queryParams = request()->queryParams;
        $queryParams['OrderSearch']['customer_username'] = get_current_user_name();
        $dataProvider = $searchModel->search($queryParams);
        $dataProvider->sort->defaultOrder = ['id' => SORT_DESC];
        $dataProvider = $searchModel->search(request()->queryParams);

        return $this->render('index', [
            'searchModel'  => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
public function actionIndex ( ) { $ searchModel = new OrderSearch ( ) ; $ queryParams = request ( ) -> queryParams ; $ queryParams [ 'OrderSearch' ] [ 'customer_username' ] = get_current_user_name ( ) ; $ dataProvider = $ searchModel -> search ( $ queryParams ) ; $ dataProvider -> sort -> defaultOrder = [ 'id' => SORT_DESC ] ; $ dataProvider = $ searchModel -> search ( request ( ) -> queryParams ) ; return $ this -> render ( 'index' , [ 'searchModel' => $ searchModel , 'dataProvider' => $ dataProvider , ] ) ; }
Lists all Order models.
@return mixed
Lists all Order models .