From 4ae73c90a580b312f59382bafc5a2ccd042e3436 Mon Sep 17 00:00:00 2001 From: tensent Date: Mon, 20 Apr 2020 20:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .example.env | 2 +- addons/sitestat/Plugin.php | 35 ++++++++++++++++------------------- app/model/Addons.php | 3 --- view/admin/menu/index.html | 2 -- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.example.env b/.example.env index 79f7c718..be46446c 100755 --- a/.example.env +++ b/.example.env @@ -1 +1 @@ -APP_DEBUG = false VERSION = 4.0.0 rootuid = 1 [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = {type} HOSTNAME = {hostname} DATABASE = {database} USERNAME = {username} PASSWORD = {password} HOSTPORT = {hostport} CHARSET = utf8 PREFIX = {prefix} DEBUG = false [LANG] default_lang = zh-cn [JWT] SECRET={secret} \ No newline at end of file +APP_DEBUG = false VERSION = 4.0.1 rootuid = 1 [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = {type} HOSTNAME = {hostname} DATABASE = {database} USERNAME = {username} PASSWORD = {password} HOSTPORT = {hostport} CHARSET = utf8 PREFIX = {prefix} DEBUG = false [LANG] default_lang = zh-cn [JWT] SECRET={secret} \ No newline at end of file diff --git a/addons/sitestat/Plugin.php b/addons/sitestat/Plugin.php index fa670bf8..2012372c 100644 --- a/addons/sitestat/Plugin.php +++ b/addons/sitestat/Plugin.php @@ -15,38 +15,35 @@ use \think\facade\Db; * @author thinkphp */ -class Plugin extends \sent\Addons{ +class Plugin extends \sent\Addons { public $info = array( - 'name'=>'Sitestat', - 'title'=>'站点统计信息', - 'description'=>'统计站点的基础信息', - 'status'=>1, - 'author'=>'molong', - 'version'=>'0.2' + 'name' => 'Sitestat', + 'title' => '站点统计信息', + 'description' => '统计站点的基础信息', + 'status' => 1, + 'author' => 'molong', + 'version' => '0.2', ); - public function install(){ + public function install() { return true; } - public function uninstall(){ + public function uninstall() { return true; } //实现的AdminIndex钩子方法 - public function AdminIndex($param){ + public function AdminIndex($param) { $config = $this->getConfig(); $this->assign('addons_config', $config); - $map['status'] = array('egt',0); - $maps['is_read'] = array('eq',0); - if($config['display']){ - $info['users'] = Db::name('Member')->where($map)->count(); - $info['userall'] = Db::name('Member')->count(); - $info['form'] = Db::name('Form')->count(); - $info['category'] = Db::name('Category')->count(); - $info['model'] = Db::name('Model')->count(); - $this->assign('info',$info); + if ($config['display']) { + $info['users'] = Db::name('Member')->count(); + $info['form'] = Db::name('Form')->count(); + $info['category'] = Db::name('Category')->count(); + $info['model'] = Db::name('Model')->count(); + $this->assign('info', $info); return $this->fetch('index/info'); } } diff --git a/app/model/Addons.php b/app/model/Addons.php index a8b2263e..0c49e36f 100644 --- a/app/model/Addons.php +++ b/app/model/Addons.php @@ -111,7 +111,6 @@ class Addons extends \think\Model { public static function uninstall($id) { $info = self::find($id); if (!$info) { - $this->error = "无此插件!"; return false; } $class = get_addons_class($info['name']); @@ -119,7 +118,6 @@ class Addons extends \think\Model { //插件卸载方法 $addons = get_addons_instance($info['name']); if (!method_exists($addons, 'uninstall')) { - $this->error = "插件卸载方法!"; return false; } $result = $addons->uninstall(); @@ -130,7 +128,6 @@ class Addons extends \think\Model { $info->save(['isinstall' => 0]); return true; } else { - $this->error = "无法卸载插件!"; return false; } } diff --git a/view/admin/menu/index.html b/view/admin/menu/index.html index 19fe86bd..bd72c740 100644 --- a/view/admin/menu/index.html +++ b/view/admin/menu/index.html @@ -20,7 +20,6 @@ ID 名称 - 上级菜单 分组 URL 排序 @@ -43,7 +42,6 @@ - {$menu.up_title|default='无'} {$menu.group} {$menu.url} {$menu['sort']}