<?php
namespace backend\modules\ib\controllers;

use backend\models\MemberApi;
use Yii;

class WithdrawController extends BaseController
{
    public function actionIndex()
    {
        /** @var \backend\models\MemberIdentity Yii::$app->user->identity */
        return $this->render('index', [
            'ibs' => $this->getIbs(),
            'isHaveAdmin' => Yii::$app->user->identity->isHaveAdmin(),
        ]);
    }

    protected function getIbs()
    {
        $api = new MemberApi();
        $result = $api->getIbs();
        if ($result['code'] == 1) {
            return $result['data'];
        } else {
            return false;
        }
    }
}