diff --git a/application/admin/controller/Appversion.php b/application/admin/controller/Appversion.php index 4e3ffba..65bd6f6 100644 --- a/application/admin/controller/Appversion.php +++ b/application/admin/controller/Appversion.php @@ -16,6 +16,7 @@ class Appversion extends Base{ $data = input(); $pd = true; $parameter = []; + // $parameter['is_del'] = 0; if(array_key_exists('tt', $data)){ $page = $data['page_num']; unset($data['page_num']); @@ -24,6 +25,7 @@ class Appversion extends Base{ // if($data['status_num'] === "0" || $data['status_num'] === "1"){ // $parameter['is_del'] = $data['status_num']; // } + // if($data['tel']){ // $parameter['tel'] = $data['tel']; // } @@ -38,7 +40,7 @@ class Appversion extends Base{ // } } $num = Db::table('app_version_log')->where($parameter)->count(); - $result = Db::table('app_version_log')->order('id desc')->page($page,$this->page_num)->select(); + $result = Db::table('app_version_log')->where($parameter)->order('is_del,id desc')->page($page,$this->page_num)->select(); if(!$pd){ $result['num'] = $num; $result['data'] = $result; @@ -100,6 +102,29 @@ class Appversion extends Base{ } + public function app_del(){ + $data = input(); + if(is_array($data['id'])){ + $data['id'] = implode(',',$data['id']); + $result = Db::table('app_version_log')->where("id in (".$data['id'].")")->update(['is_del'=>$data['is_del']]); + }else{ + $result = Db::table('app_version_log')->where(['id'=>$data['id']])->update(['is_del'=>$data['is_del']]); + } + + if($result){ + return $this->msg(0,'success'); + }else{ + return $this->msg(10001,'success'); + } + + // $num = Db::table('app_version_log')->where(['id'=>$data['id']])->update(['is_del'=>1]); + // if($num){ + // return $this->msg([]); + // }else{ + // return $this->msg(10002); + // } + } + ################################################################other################################################################ ################################################################other################################################################ diff --git a/application/admin/view/appversion/index.html b/application/admin/view/appversion/index.html index c210a10..6b30950 100644 --- a/application/admin/view/appversion/index.html +++ b/application/admin/view/appversion/index.html @@ -58,7 +58,7 @@ -->
- +
@@ -66,26 +66,35 @@ - + + {volist name="result" id="vo"} - + - + + {/volist} @@ -168,7 +177,7 @@ }); /*用户-停用*/ - function member_stop(obj,id){ + function app_stop(obj,id){ // return var title = '',is_del,num @@ -185,7 +194,7 @@ layer.confirm('确认要'+ title +'吗?',function(index){ load() $.ajax({ - url:"member_is_del", //请求的url地址 + url:"/appversion/app_del", //请求的url地址 dataType:"json", //返回格式为json async:true,//请求是否异步,默认为异步,这也是ajax重要特性 data:{"id":id,'is_del':is_del}, //参数值 @@ -229,7 +238,7 @@ layer.confirm('确认要停用吗?ID为:'+ids.toString(),function(index){ //捉到所有被选中的,发异步进行删除 $.ajax({ - url:"member_is_del", //请求的url地址 + url:"/appversion/app_del", //请求的url地址 dataType:"json", //返回格式为json async:true,//请求是否异步,默认为异步,这也是ajax重要特性 data:{"id":ids,'is_del':1}, //参数值 diff --git a/application/app/controller/Index.php b/application/app/controller/Index.php index 2914eed..985dc3b 100644 --- a/application/app/controller/Index.php +++ b/application/app/controller/Index.php @@ -58,7 +58,7 @@ class Index extends Base{ if(!array_key_exists('token', $data)){ return $this->msg(10001); } - $result = Db::table('app_version_log')->order('id desc')->find(); + $result = Db::table('app_version_log')->order('is_del,id desc')->find(); if($result){ $version = $result['version_num_original']; $url = $result['download_url']; @@ -67,7 +67,7 @@ class Index extends Base{ $url = ''; } if($this->token_time_validate($data['token']) === false){ - return $this->msg(20001,'未登录',['version'=>$version,'url'=>$url]); + return $this->msg(-1,'未登录',['version'=>$version,'url'=>$url]); }else{ return $this->msg(['version'=>$version,'url'=>$url]); } diff --git a/application/config.php b/application/config.php index 53fc153..25d573c 100644 --- a/application/config.php +++ b/application/config.php @@ -95,7 +95,7 @@ return [ // 是否开启路由解析缓存 'route_check_cache' => false, // 是否强制使用路由 - 'url_route_must' => true, + 'url_route_must' => false, // 域名部署 'url_domain_deploy' => false, // 域名根,如thinkphp.cn diff --git a/application/route.php b/application/route.php index d1eaa80..c52e4c2 100644 --- a/application/route.php +++ b/application/route.php @@ -31,6 +31,7 @@ Route::any('/admin/welcome', 'admin/index/welcome'); // APP版本管理 Route::any('/appversion/index', 'admin/appversion/index'); Route::any('/appversion/app_add', 'admin/appversion/app_add'); +Route::any('/appversion/app_del', 'admin/appversion/app_del'); Route::any('/appversion/app_add_action', 'admin/appversion/app_add_action');
ID 文件名 版本号 描述 创建时间 下载状态
{$vo.id} {$vo.name} {$vo.version_num} {$vo.content} {$vo.create_time}下载点击下载 + {if condition="$vo.is_del == 1"} + 已停用 + {else /} + 已启用 + {/if} + +