forked from kuafuRace/phprap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomeController.php
More file actions
executable file
·44 lines (34 loc) · 1002 Bytes
/
HomeController.php
File metadata and controls
executable file
·44 lines (34 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace app\controllers\admin;
use app\models\Api;
use app\models\Module;
use app\models\Project;
use app\models\Tongji;
use Yii;
use yii\helpers\Url;
/**
* Site controller
*/
class HomeController extends PublicController
{
/**
* Displays homepage.
*
* @return string
*/
public function actionIndex()
{
if(Yii::$app->user->isGuest){
return $this->redirect(['home/account/login', 'callback' => Url::current()]);
}
// 系统信息
$system['installed_at'] = Project::findModel()->getInstallTime();
$system['app_os'] = PHP_OS;
$system['app_version'] = Yii::$app->params['app_version'];
$system['php_version'] = PHP_VERSION;
$system['mysql_version'] = Yii::$app->db->createCommand('select version()')->queryScalar();
// 统计信息
$tongji = new Tongji();
return $this->display('index', ['system' => array2object($system), 'tongji' => $tongji]);
}
}