Commit 1ec7187e authored by shajiaiming's avatar shajiaiming

beta

parent 735bdb8a
......@@ -28,7 +28,12 @@ class RecommendCoinController extends BaseController
//$this->data[$coin->coin[0]['chain']] = $coin->coin;
$this->data = array_merge($this->data, $coin->coin);
}
echo json_encode($this->data);exit;
$chains = array_column($this->data, 'chain');
$symbol = array_column($this->data, 'name');
$name = array_keys(array_flip($chains) + array_flip($symbol));
echo json_encode($name);
exit;
$coin_quotations = ExchangeBusiness::getQuatationByNames($chains);
$i = 0;
......
......@@ -3,9 +3,7 @@
namespace common\models\psources;
use Yii;
use yii\db\Expression;
use common\core\BaseActiveRecord;
use yii\behaviors\TimestampBehavior;
class RecommendCoin extends BaseActiveRecord
{
......@@ -21,6 +19,6 @@ class RecommendCoin extends BaseActiveRecord
public function getCoin()
{
return $this->hasOne(Coin::className(), ['id' => 'cid'])->select(['id', 'sid', 'icon', 'name', 'introduce', 'optional_name', 'nickname', 'platform', 'chain', 'treaty'])->asArray()->all();
return $this->hasOne(WalletCoin::className(), ['id' => 'cid'])->select(['id', 'sid', 'icon', 'name', 'introduce', 'nickname', 'platform', 'chain', 'treaty', 'exchange_id'])->asArray()->all();
}
}
\ No newline at end of file
<?php
namespace common\models\psources;
use Yii;
use common\core\BaseActiveRecord;
class WalletCoin extends BaseActiveRecord
{
public static function getDb()
{
return Yii::$app->get('p_sources');
}
public static function tableName()
{
return '{{wallet_coin}}';
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment