frontend/controllers/ResellerController.php
/**
     * Renders vouchers which can be payed
     *
     * @return mixed
     */
Renders vouchers which can be payed
@return mixed
Renders vouchers which can be payed @return mixed
public function actionPayVouchers()
    {
        $user = Yii::$app->user->identity;
        $vouchQuery = Voucher::find()
            ->with('product')
            ->where(['issuer_id' => $user->id])
            ->andWhere(['<>', 'status', Voucher::STATUS_SUSPENDED])
            ->andWhere(['is_payed' => 0]);
        $vouchCountQuery = clone $vouchQuery;
        $pagination = new Pagination([
            'defaultPageSize' => 10,
            'totalCount' => $vouchCountQuery->count(),
            'route' => Yii::getAlias('@reseller_pay_vouchers')
        ]);
        $vouchQuery->orderBy(['created' => SORT_DESC]);
        $vouchQuery->offset($pagination->offset);
        $vouchQuery->limit($pagination->limit);
        $checkoutSuccessMessage = Yii::$app->session->getFlash('checkoutSuccessMessage', null);
        $checkoutErrorMessage = Yii::$app->session->getFlash('checkoutErrorMessage', null);
        $pageRepo = Yii::$container->get('common\repositories\PagesRepository');
        $pageMeta = $pageRepo->getPageMetaData('reseller-pay-vouchers');
        $pageTitle = $pageRepo->getPageTitle('reseller-pay-vouchers');
        $this->layout = 'reseller';
        return $this->render('payVouchers', [
            'meta' => $pageMeta,
            'title' => $pageTitle,
            'vouchers' => $vouchQuery->all(),
            'pag' => $pagination,
            'checkoutSuccessMessage' => $checkoutSuccessMessage,
            'checkoutErrorMessage' => $checkoutErrorMessage
        ]);
    }
public function actionPayVouchers ( ) { $ user = Yii :: $ app -> user -> identity ; $ vouchQuery = Voucher :: find ( ) -> with ( 'product' ) -> where ( [ 'issuer_id' => $ user -> id ] ) -> andWhere ( [ '<>' , 'status' , Voucher :: STATUS_SUSPENDED ] ) -> andWhere ( [ 'is_payed' => 0 ] ) ; $ vouchCountQuery = clone $ vouchQuery ; $ pagination = new Pagination ( [ 'defaultPageSize' => 10 , 'totalCount' => $ vouchCountQuery -> count ( ) , 'route' => Yii :: getAlias ( '@reseller_pay_vouchers' ) ] ) ; $ vouchQuery -> orderBy ( [ 'created' => SORT_DESC ] ) ; $ vouchQuery -> offset ( $ pagination -> offset ) ; $ vouchQuery -> limit ( $ pagination -> limit ) ; $ checkoutSuccessMessage = Yii :: $ app -> session -> getFlash ( 'checkoutSuccessMessage' , null ) ; $ checkoutErrorMessage = Yii :: $ app -> session -> getFlash ( 'checkoutErrorMessage' , null ) ; $ pageRepo = Yii :: $ container -> get ( 'common\repositories\PagesRepository' ) ; $ pageMeta = $ pageRepo -> getPageMetaData ( 'reseller-pay-vouchers' ) ; $ pageTitle = $ pageRepo -> getPageTitle ( 'reseller-pay-vouchers' ) ; $ this -> layout = 'reseller' ; return $ this -> render ( 'payVouchers' , [ 'meta' => $ pageMeta , 'title' => $ pageTitle , 'vouchers' => $ vouchQuery -> all ( ) , 'pag' => $ pagination , 'checkoutSuccessMessage' => $ checkoutSuccessMessage , 'checkoutErrorMessage' => $ checkoutErrorMessage ] ) ; }
Renders vouchers which can be payed
 @return mixed
Renders vouchers which can be payed @return mixed