Commit 256129784ef20c7a8af055c1d956d1664affe61c

Authored by teemitop
1 parent 4e081570

灰度更新时间PC维护

... ... @@ -149,4 +149,20 @@ class Api{
return json_encode($result);
}
}
//获取灰度更新时间
public function getdotime() {
$dotime = db('dotime')->where(array('id'=>1))->select();
//echo db::table('dotime')->getLastSql();die;
if($dotime){
$result['ret'] = 200;
$result['data'] = $dotime[0]['dtime'];
$result['msg'] = 'success';
}else{
$result['ret'] = 0;
$result['data'] = '';
$result['msg'] = 'fail';
}
return json_encode($result);
}
}
\ No newline at end of file
... ...
... ... @@ -402,6 +402,8 @@ class Template extends Common{
$result = ['code'=>0,'msg'=>'获取成功!','data'=>$list,'rel'=>1];
return $result;
}
$dotime = db('dotime')->select();
$this->assign ( 'dotime',$dotime[0] );
$this->assign ( 'title','安卓包管理' );
return view();
}
... ... @@ -671,4 +673,17 @@ class Template extends Common{
}
return view();
}
//变更灰度更新时间
public function editupdatedotime(){
if (request()->isAjax()) {
$dotime = input('dotime');
$res = db('dotime')->where([ 'id' => 1])->update(array('dtime'=>$dotime));
if($res > 0)
return json(['code' => 1, 'msg' => '设置成功!']);
else
return json(['code' => 0, 'msg' => '无变化!']);
}
return view();
}
}
\ No newline at end of file
... ...
... ... @@ -5,12 +5,20 @@
</fieldset>
<div class="layui-field-box">
<blockquote class="layui-elem-quote">
<a href="{:url('android')}" class="layui-btn layui-btn-sm layui-btn-danger">
<div class="layui-form-item">
<div class="layui-input-inline" style="width: 100px;">
<input type="text" name="dotime" id="dotime" value="{$dotime.dtime}" autocomplete="off" class="layui-input">
</div>
<button class="layui-btn layui-btn" onclick="editUpdateDotime()">
<i class="fa fa-file-image-o"></i> 灰度更新时间(点击更新)
</button>
<a href="{:url('android')}" class="layui-btn layui-btn layui-btn-danger">
<i class="fa fa-file-image-o"></i> 下载包
</a>
<a href="{:url('androidUpload')}" class="layui-btn layui-btn-sm">
<a href="{:url('androidUpload')}" class="layui-btn layui-btn">
<i class="fa fa-file-image-o"></i> 上传包
</a>
</div>
</blockquote>
<table class="layui-table" id="list" lay-filter="list"></table>
</div>
... ... @@ -20,7 +28,7 @@
<a class="layui-btn layui-btn-xs" href="{{d.file_url}}" lay-event="dow">{:lang('dow')}</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
</script>
<script src="/static/common/js/jquery-1.8.1.min.js"></script>
<script>
layui.use(['table','form'], function() {
var table = layui.table,form = layui.form,$ = layui.jquery;
... ... @@ -57,6 +65,23 @@
}
});
});
//变更灰度更新时间
function editUpdateDotime(){
var dotime = $("#dotime").val();
$.ajax({
url : "/admin/template/editupdatedotime",
type : "post",
async : true,
data : { "dotime" : dotime},
success : function(data){
if(data['code'] > 0){
layer.msg(data.msg,{time:1000,icon:1});
}else{
layer.msg(data.msg,{time:1000,icon:2});
}
}
})
}
</script>
</body>
</html>
\ No newline at end of file
... ...