<?php

namespace api\controllers;

use api\base\BaseController;
use common\models\psources\CoinAirDropTrade;
use common\models\psources\CoinSupportedSymbol;
use common\service\chain33\Chain33Service;
use Yii;


class SupportedSymbolController extends BaseController
{
    public function actionSearch()
    {
        $platform_withhold_id = Yii::$app->request->get('id', '');
        if (empty($platform_withhold_id)) {
            $msg = '参数不能为空';
            $code = -1;
            $data = null;
            goto doEnd;
        }

        $coinSupportedSymbol = CoinSupportedSymbol::find()->select('symbol')->where(['platform_withhold_id' => $platform_withhold_id])->asArray()->all();
        $data = array_column($coinSupportedSymbol, 'symbol');
        $code = 0;
        $msg = 'success';

        doEnd :
        return ['code' => $code, 'msg' => $msg, 'data' => $data];
    }
}