Commit 53a0c840 authored by ZhuChunYang's avatar ZhuChunYang

update

parent d8e1223d
......@@ -32,6 +32,7 @@ class CoinController extends BaseController
$limit = $request->get('limit', 10);
$name = $request->get('name', null);
$platform = $request->get('platform', '');
$chain = $request->get('chain', '');
$recommend = $request->get('recommend', '');
$condition = [];
......@@ -40,7 +41,10 @@ class CoinController extends BaseController
$condition[] = ['like', 'name', $name];
}
if ($platform != '') {
$condition[] = ['chain' => $platform];
$condition[] = ['platform' => $platform];
}
if ($chain != '') {
$condition[] = ['chain' => $chain];
}
if (Yii::$app->user->id != Yii::$app->params['admin']) {
$platform_id = Yii::$app->user->identity->platform_id;
......@@ -58,8 +62,9 @@ class CoinController extends BaseController
return $data;
}
$platforms = Coin::getChainList();
return $this->render('index', ['platforms' => $platforms]);
$platforms = Coin::getPlatformList();
$chains = Coin::getChainList();
return $this->render('index', ['platforms' => $platforms,'chains' => $chains]);
}
public function actionAdd()
......
......@@ -32,7 +32,7 @@ IndexAsset::register($this);
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="margin-bottom: 0; width: 100px;">类型</label>
<label class="layui-form-label" style="margin-bottom: 0; width: 100px;">平台</label>
<div class="layui-input-inline">
<select name="platform">
<option value="">全部</option>
......@@ -43,6 +43,17 @@ IndexAsset::register($this);
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="margin-bottom: 0; width: 100px;">类型</label>
<div class="layui-input-inline">
<select name="chain">
<option value="">全部</option>
<?php foreach ($chains as $chain): ?>
<option value="<?= $chain ?>"><?= $chain ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="margin-bottom: 0; width: 100px;">推介币种</label>
<div class="layui-input-inline">
<select name="recommend">
......@@ -64,7 +75,7 @@ IndexAsset::register($this);
<script type="text/html" id="iconTpl">
<img src="{{d.icon}}" style="max-width: 32px; max-height: 32px;"/>
<a href="{{d.icon}}" target="_blank"><img src="{{d.icon}}" style="max-width: 32px; max-height: 32px;"/></a>
</script>
<script type="text/html" id="officialTpl">
{{# if(d.official){ }}
......
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