2021-01-30 20:59:12 +08:00
|
|
|
<?php
|
2021-07-26 17:41:59 +08:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2021 勾股工作室
|
2021-11-24 17:17:29 +08:00
|
|
|
* @license https://opensource.org/licenses/Apache-2.0
|
2021-07-26 17:41:59 +08:00
|
|
|
* @link https://www.gougucms.com
|
|
|
|
*/
|
|
|
|
|
2021-01-30 20:59:12 +08:00
|
|
|
declare (strict_types = 1);
|
|
|
|
|
|
|
|
namespace app\admin\controller;
|
|
|
|
|
|
|
|
use app\admin\BaseController;
|
|
|
|
use think\facade\Db;
|
|
|
|
use think\facade\View;
|
|
|
|
|
|
|
|
class Index extends BaseController
|
|
|
|
{
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$menu = get_admin_menus();
|
|
|
|
View::assign('menu', $menu);
|
|
|
|
return View();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function main()
|
|
|
|
{
|
2021-07-26 17:41:59 +08:00
|
|
|
$adminCount = Db::name('Admin')->where('status', '1')->count();
|
|
|
|
$userCount = Db::name('User')->where('status', '1')->count();
|
|
|
|
$articleCount = Db::name('Article')->where('status', '1')->count();
|
|
|
|
$install = false;
|
2021-02-25 01:06:21 +08:00
|
|
|
if (file_exists(CMS_ROOT . 'app/install')) {
|
2021-07-26 17:41:59 +08:00
|
|
|
$install = true;
|
2021-02-25 01:06:21 +08:00
|
|
|
}
|
2021-01-30 20:59:12 +08:00
|
|
|
View::assign('adminCount', $adminCount);
|
|
|
|
View::assign('userCount', $userCount);
|
|
|
|
View::assign('articleCount', $articleCount);
|
2021-02-25 01:06:21 +08:00
|
|
|
View::assign('install', $install);
|
2021-01-30 20:59:12 +08:00
|
|
|
return View();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function errorShow()
|
|
|
|
{
|
|
|
|
echo '错误';
|
|
|
|
}
|
2021-07-26 17:41:59 +08:00
|
|
|
|
2021-01-30 20:59:12 +08:00
|
|
|
}
|