优化
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user