Commit 9d7aa110 authored by shajiaming's avatar shajiaming

fix

parent a15680b8
......@@ -128,11 +128,15 @@ class CoinController extends BaseController
$limit = $request->post('limit', 999);
$platform_id = $request->post('platform_id', 1);//默认币钱包
$recommend = $request->post('recommend', '');
$chain = $request->post('chain', '');
$condition = ['platform_id' => $platform_id, 'type' => 1];
if ($recommend) {
$condition['recommend'] = $recommend;
}
if ($chain) {
$condition['chain'] = $chain;
}
$select = ['id', 'sid', 'icon', 'name', 'introduce', 'optional_name', 'nickname', 'platform', 'chain', 'treaty'];
$order_by = ['sort' => SORT_ASC];
$datas = CoinRecommend::getList($page, $limit, $condition, $order_by, $select);
......
......@@ -8,12 +8,42 @@ use common\models\psources\CoinAirDropTrade;
use common\models\psources\CoinIssueTransfer;
use common\models\psources\CoinPlatform;
use common\models\psources\CoinPlatformWithHold;
use common\models\psources\WalletSupportedTokenCategory;
use common\service\chain33\Chain33Service;
use Yii;
class WalletController extends BaseController
{
public function actionTokenCategory()
{
$header = Yii::$app->request->headers;
$platform_id = $header['FZM-PLATFORM-ID'] ?? null;
if (empty($platform_id)) {
$this->msg = '缺少必要参数';
$this->code = -1;
goto doEnd;
}
$this->data = [
[
'category' => '首页',
'chain' => null
],
[
'category' => '首页',
'chain' => null
]
];
$data = WalletSupportedTokenCategory::find()->select('category, chain')->where(['platform_id' => (int)$platform_id])->asArray()->all();
if (empty($data)) {
goto doEnd;
}
$this->data = array_merge($this->data, $data);
doEnd :
return ['code' => $this->code, 'data' => $this->data, 'msg' => $this->msg];
}
public function actionInfo()
{
$code = 0;
......
<?php
namespace common\models\psources;
use Yii;
use common\core\BaseActiveRecord;
class WalletSupportedTokenCategory extends BaseActiveRecord
{
public static function getDb()
{
return Yii::$app->get('p_sources');
}
public static function tableName()
{
return '{{wallet_supported_token_catetory}}';
}
}
\ 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