cập nhật tính năng quản trị phòng ban

This commit is contained in:
2020-10-07 17:29:30 +07:00
parent 586be80cf6
commit 2d15fc1c14
22 changed files with 1041 additions and 72 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace app\helpers;
use yii\helpers\Html;
use yii\helpers\Url;
class DepartmentGrid extends CommonGrid {
public static function pid($departmentArray) {
return function($model) use ($departmentArray) {
return isset($departmentArray[$model->pid]) ? $departmentArray[$model->pid] : "";
};
}
public static function checkbox() {
return function($model) {
if ($model->id == 1)
return "";
return "<input type='checkbox' value='{$model->id}' name='checkbox-department' class='checkbox-department'>";
};
}
public static function rows() {
return function($model, $index, $widget, $grid) {
return [
"onclick" => "common.form(this, 'department');",
"style" => "cursor: pointer;",
"data" => [
"href" => Url::to(["update", "id" => $model->id])
]
];
};
}
}