Commit 4da3a64e authored by ZhuChunYang's avatar ZhuChunYang

update

parent 7707b03d
......@@ -76,4 +76,12 @@ class ApplicationController extends BaseController
return ['code' => 1,'data' => [],'msg' => 'id不能为空'];
}
}
/**
* 应用排行榜
*/
public function actionRankList()
{
}
}
\ No newline at end of file
......@@ -67,7 +67,6 @@ class CoinController extends BaseController
}
$select = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain'];
$datas = CoinRecommend::getList($page, $limit, $condition, [], $select);
//获取详细信息
$coin_recommends = &$datas['data'];
if (!empty($coin_recommends)) {
......
......@@ -88,15 +88,15 @@ class ApplicateRankController extends BaseController
$type = $request->get('type', '');
$sort = $request->get('sort', 1);
if ($id && $type) {
$recommend = CoinApplicateRecommend::getRecommend($id, $type);
if (!$recommend) {
return ['code' => 1, 'msg' => '首页推荐不存在,不能设置排序'];
$rank = CoinApplicateRank::getApplicate($id, $type);
if (!$rank) {
return ['code' => 1, 'msg' => '应用不存在,不能设置排序'];
}
$recommend->sort = $sort;
$recommend->save();
return ['code' => 0, 'msg' => '首页推荐排序设置成功'];
$rank->sort = $sort;
$rank->save();
return ['code' => 0, 'msg' => '排序设置成功'];
} else {
return ['code' => 1, 'msg' => '首页推荐排序设置失败'];
return ['code' => 1, 'msg' => '排序设置失败'];
}
}
}
......
......@@ -19,11 +19,11 @@ IndexAsset::register($this);
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<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 class="layui-tab-item">
<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>
......
......@@ -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 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) {
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{
}
......
......@@ -7,11 +7,9 @@
*/
namespace h5\controllers;
use common\models\psources\CoinApplicateRank;
use common\models\psources\CoinLottery;
use h5\base\ResponseBuild;
use Yii;
use common\models\psources\Coin;
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