26 lines
508 B
PHP
26 lines
508 B
PHP
<?php
|
|
|
|
namespace app\widgets;
|
|
|
|
use yii\base\Widget;
|
|
use app\models\SystemLogs;
|
|
use app\models\User;
|
|
|
|
class SystemLogsView extends Widget {
|
|
|
|
public $type;
|
|
|
|
public function init() {
|
|
parent::init();
|
|
}
|
|
|
|
public function run() {
|
|
|
|
return $this->render("system-logs-view", [
|
|
"logs" => SystemLogs::find()->andWhere(["type" => $this->type])->orderBy(['time' => SORT_DESC])->limit(30)->all(),
|
|
"userArray" => User::userArray()
|
|
]);
|
|
}
|
|
|
|
}
|