Commit 4fc88e48 authored by shajiaiming's avatar shajiaiming

fix

parent b35c8b41
...@@ -68,7 +68,7 @@ class CoinController extends BaseController ...@@ -68,7 +68,7 @@ class CoinController extends BaseController
} }
$recommend = $request->post('recommend', ''); $recommend = $request->post('recommend', '');
$condition = ['platform_id' => $platform_id]; $condition = ['platform_id' => $platform_id, 'type' => 1];
if ($recommend) { if ($recommend) {
$condition['recommend'] = $recommend; $condition['recommend'] = $recommend;
} }
...@@ -126,7 +126,7 @@ class CoinController extends BaseController ...@@ -126,7 +126,7 @@ class CoinController extends BaseController
$platform_id = $request->post('platform_id', 1);//默认币钱包 $platform_id = $request->post('platform_id', 1);//默认币钱包
$recommend = $request->post('recommend', ''); $recommend = $request->post('recommend', '');
$condition = ['platform_id' => $platform_id]; $condition = ['platform_id' => $platform_id, 'type' => 1];
if ($recommend) { if ($recommend) {
$condition['recommend'] = $recommend; $condition['recommend'] = $recommend;
} }
......
...@@ -109,6 +109,14 @@ ...@@ -109,6 +109,14 @@
{{# } }} {{# } }}
</script> </script>
<script type="text/html" id="type_tpl">
{{# if(1 == d.type){ }}
币钱包
{{# } else if(2 == d.type){ }}
托管钱包
{{# } }}
</script>
<script type="text/html" id="toolBar"> <script type="text/html" id="toolBar">
<button class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">编辑</button> <button class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">编辑</button>
<button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</button> <button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</button>
...@@ -149,6 +157,11 @@ table.render({ ...@@ -149,6 +157,11 @@ table.render({
templet: '#recommend_tpl' templet: '#recommend_tpl'
}, },
{ {
field: 'type',
title: '所属类型',
templet: '#type_tpl'
},
{
field: 'sort', field: 'sort',
title: '排序' title: '排序'
}, },
...@@ -177,7 +190,8 @@ table.on('toolbar(table1)', function(obj) { ...@@ -177,7 +190,8 @@ table.on('toolbar(table1)', function(obj) {
platform_id: $('#platform_id').val(), platform_id: $('#platform_id').val(),
coin: '', coin: '',
sort: '', sort: '',
recommend: '' recommend: '',
type:''
}); });
}, },
btn1: function() { btn1: function() {
...@@ -223,7 +237,8 @@ table.on('tool(table1)', function(obj) { ...@@ -223,7 +237,8 @@ table.on('tool(table1)', function(obj) {
platform_id: data.platform_id, platform_id: data.platform_id,
coin: data.coin, coin: data.coin,
sort: data.sort, sort: data.sort,
recommend: data.recommend recommend: data.recommend,
type: data.type
}); });
}, },
btn1: function() { btn1: function() {
......
...@@ -92,7 +92,7 @@ class CoinRecommend extends BaseActiveRecord ...@@ -92,7 +92,7 @@ class CoinRecommend extends BaseActiveRecord
$coin_recommend = CoinRecommend::findOne($id); $coin_recommend = CoinRecommend::findOne($id);
} else { } else {
$coin_recommend = new CoinRecommend(); $coin_recommend = new CoinRecommend();
$count = self::find()->where(['cid' => $coin->id, 'platform_id' => $platform_id])->count(); $count = self::find()->where(['cid' => $coin->id, 'platform_id' => $platform_id, 'type' => $type])->count();
if ($count > 0) { if ($count > 0) {
return ['code' => -1, 'msg' => '推荐币种已经存在']; return ['code' => -1, 'msg' => '推荐币种已经存在'];
} }
......
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