init Area full CRUD

This commit is contained in:
2020-10-09 14:19:15 +07:00
parent 5538d74b1b
commit 70db83d3ab
15 changed files with 318 additions and 144 deletions

View File

@@ -5,7 +5,6 @@ namespace app\controllers;
use Yii;
use app\models\Department;
use app\models\DepartmentSearch;
use app\models\SystemLogs;
use app\models\common;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
@@ -225,10 +224,7 @@ class DepartmentController extends Controller {
Yii::$app->response->format = "json";
return [
"title" => Html::tag("i", "", ["class" => "fa fa-file"]) . " Ghi nhận hệ thống",
"form" => $this->renderPartial("logs", [
"logs" => SystemLogs::find()->andWhere(["type" => Yii::$app->controller->id])->orderBy(['time' => SORT_DESC])->limit(30)->all(),
"userArray" => \app\models\User::userArray()
])
"form" => \app\widgets\SystemLogsView::widget(['type' => Yii::$app->controller->id])
];
}
}
@@ -238,9 +234,7 @@ class DepartmentController extends Controller {
Yii::$app->response->format = "json";
return [
"title" => Html::tag("i", "", ["class" => "fa fa-sitemap"]) . " Cây thư mục",
"form" => $this->renderPartial("tree", [
"root" => Department::findOne(1)
])
"form" => \app\widgets\Tree::widget(["model" => new Department()])
];
}
}