Commit cb8c089e authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into 'master'

fix See merge request !47
parents 3a12c875 4fc88e48
......@@ -68,7 +68,7 @@ class CoinController extends BaseController
}
$recommend = $request->post('recommend', '');
$condition = ['platform_id' => $platform_id];
$condition = ['platform_id' => $platform_id, 'type' => 1];
if ($recommend) {
$condition['recommend'] = $recommend;
}
......@@ -126,7 +126,7 @@ class CoinController extends BaseController
$platform_id = $request->post('platform_id', 1);//默认币钱包
$recommend = $request->post('recommend', '');
$condition = ['platform_id' => $platform_id];
$condition = ['platform_id' => $platform_id, 'type' => 1];
if ($recommend) {
$condition['recommend'] = $recommend;
}
......
......@@ -109,6 +109,14 @@
{{# } }}
</script>
<script type="text/html" id="type_tpl">
{{# if(1 == d.type){ }}
币钱包
{{# } else if(2 == d.type){ }}
托管钱包
{{# } }}
</script>
<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-danger" lay-event="del">删除</button>
......@@ -149,6 +157,11 @@ table.render({
templet: '#recommend_tpl'
},
{
field: 'type',
title: '所属类型',
templet: '#type_tpl'
},
{
field: 'sort',
title: '排序'
},
......@@ -177,7 +190,8 @@ table.on('toolbar(table1)', function(obj) {
platform_id: $('#platform_id').val(),
coin: '',
sort: '',
recommend: ''
recommend: '',
type:''
});
},
btn1: function() {
......@@ -223,7 +237,8 @@ table.on('tool(table1)', function(obj) {
platform_id: data.platform_id,
coin: data.coin,
sort: data.sort,
recommend: data.recommend
recommend: data.recommend,
type: data.type
});
},
btn1: function() {
......
......@@ -92,7 +92,7 @@ class CoinRecommend extends BaseActiveRecord
$coin_recommend = CoinRecommend::findOne($id);
} else {
$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) {
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