Commit 4da3a64e authored by ZhuChunYang's avatar ZhuChunYang

update

parent 7707b03d
...@@ -76,4 +76,12 @@ class ApplicationController extends BaseController ...@@ -76,4 +76,12 @@ class ApplicationController extends BaseController
return ['code' => 1,'data' => [],'msg' => 'id不能为空']; return ['code' => 1,'data' => [],'msg' => 'id不能为空'];
} }
} }
/**
* 应用排行榜
*/
public function actionRankList()
{
}
} }
\ No newline at end of file
...@@ -67,7 +67,6 @@ class CoinController extends BaseController ...@@ -67,7 +67,6 @@ class CoinController extends BaseController
} }
$select = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain']; $select = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain'];
$datas = CoinRecommend::getList($page, $limit, $condition, [], $select); $datas = CoinRecommend::getList($page, $limit, $condition, [], $select);
//获取详细信息 //获取详细信息
$coin_recommends = &$datas['data']; $coin_recommends = &$datas['data'];
if (!empty($coin_recommends)) { if (!empty($coin_recommends)) {
......
...@@ -88,15 +88,15 @@ class ApplicateRankController extends BaseController ...@@ -88,15 +88,15 @@ class ApplicateRankController extends BaseController
$type = $request->get('type', ''); $type = $request->get('type', '');
$sort = $request->get('sort', 1); $sort = $request->get('sort', 1);
if ($id && $type) { if ($id && $type) {
$recommend = CoinApplicateRecommend::getRecommend($id, $type); $rank = CoinApplicateRank::getApplicate($id, $type);
if (!$recommend) { if (!$rank) {
return ['code' => 1, 'msg' => '首页推荐不存在,不能设置排序']; return ['code' => 1, 'msg' => '应用不存在,不能设置排序'];
} }
$recommend->sort = $sort; $rank->sort = $sort;
$recommend->save(); $rank->save();
return ['code' => 0, 'msg' => '首页推荐排序设置成功']; return ['code' => 0, 'msg' => '排序设置成功'];
} else { } else {
return ['code' => 1, 'msg' => '首页推荐排序设置失败']; return ['code' => 1, 'msg' => '排序设置失败'];
} }
} }
} }
......
...@@ -19,11 +19,11 @@ IndexAsset::register($this); ...@@ -19,11 +19,11 @@ IndexAsset::register($this);
<div class="layui-tab-content"> <div class="layui-tab-content">
<div class="layui-tab-item layui-show"> <div class="layui-tab-item layui-show">
<button class="layui-btn layui-btn-default" id="add1">添加热度应用</button> <button class="layui-btn layui-btn-default" id="add1">添加热度应用</button>
<table class="layui-table" id="table1" lay-filter="table"></table> <table class="layui-table" id="table1" lay-filter="table1"></table>
</div> </div>
<div class="layui-tab-item"> <div class="layui-tab-item">
<button class="layui-btn layui-btn-default" id="add2">添加新品应用</button> <button class="layui-btn layui-btn-default" id="add2">添加新品应用</button>
<table class="layui-table" id="table2" lay-filter="table"></table> <table class="layui-table" id="table2" lay-filter="table2"></table>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -100,13 +100,27 @@ function after_close_add(reflush = true) { ...@@ -100,13 +100,27 @@ function after_close_add(reflush = true) {
} }
//监听单元格编辑 //监听单元格编辑
table.on('edit(table1)', function(obj){ layui.table.on('edit(table1)', function(obj){
var value = obj.value; //得到修改后的值 var value = obj.value; //得到修改后的值
var data = obj.data; //得到所在行所有键值 var data = obj.data; //得到所在行所有键值
$.get('/admin/applicate-rank/set-sort', {id:data.id,type:data.type,sort:value}, function(rev) { $.get('/admin/applicate-rank/set-sort', {id:data.id,type:data.type,sort:value}, function(rev) {
layer.msg(rev.msg); layer.msg(rev.msg);
if (0 == rev.code) { if (0 == rev.code) {
table.reload('table1',{}); table1.reload('table1',{});
}else{
}
});
});
//监听单元格编辑
layui.table.on('edit(table2)', function(obj){
var value = obj.value; //得到修改后的值
var data = obj.data; //得到所在行所有键值
$.get('/admin/applicate-rank/set-sort', {id:data.id,type:data.type,sort:value}, function(rev) {
layer.msg(rev.msg);
if (0 == rev.code) {
table2.reload('table2',{});
}else{ }else{
} }
......
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
*/ */
namespace h5\controllers; namespace h5\controllers;
use common\models\psources\CoinApplicateRank;
use common\models\psources\CoinLottery; use common\models\psources\CoinLottery;
use h5\base\ResponseBuild; use h5\base\ResponseBuild;
use Yii; use Yii;
use common\models\psources\Coin;
use h5\base\BaseController; use h5\base\BaseController;
/** /**
......
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