<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2018/8/17 
 * Time: 23:47
 */
namespace backend\modules\user\controllers;



use backend\models\SameaccountApi;

class SameaccountController extends BaseController
{
    public $enableCsrfValidation = false;

    public function actionIndex()
    {
        return $this->render('index', []);
    }

    /**
     * 同名转账申请
     */
    public function actionSave()
    {
        $request = \Yii::$app->request;
        if ($request->isPost) {
            $params = $request->post();
            $member_id = $this->getMemberId();
            $params['member_id'] = isset($member_id) ? $member_id : '';
            $params['lever'] = isset($params['lever']) ? trim($params['lever']) : '100';
            $sameaccountApi = new SameaccountApi();
            $rs = $sameaccountApi->addAccount($params);
            return $this->asJson($rs);
        }
    }

    /**
     * 成功页面
     * @return string
     */
    public function actionSuccess()
    {
        $data = \Yii::$app->request->get();
        return $this->render('success', [
            'data' => $data,
        ]);
    }

}