diff --git a/controllers/AssignController.php b/controllers/AssignController.php index 28c98dc0..daf65d1f 100644 --- a/controllers/AssignController.php +++ b/controllers/AssignController.php @@ -93,7 +93,7 @@ class AssignController extends Controller { public function actionSetSchedule() { if (Yii::$app->request->post()) { $post = Yii::$app->request->post(); - if ($post['currentDepartment'] !== "" && count($post["staffs"]) >= Yii::$app->params["pageSize"]) { + if ($post['all'] == "true") { $model = new Department(); $childs = $model->departmentChilds($post["currentDepartment"]); $lists = Staff::find()->andWhere(["IN", "department_id", $childs])->all(); diff --git a/controllers/DeviceController.php b/controllers/DeviceController.php index 99eede21..166ceb88 100644 --- a/controllers/DeviceController.php +++ b/controllers/DeviceController.php @@ -383,7 +383,7 @@ class DeviceController extends Controller { Yii::$app->response->format = "json"; $post = Yii::$app->request->post(); $lists = $post["lists"]; - if ($post["all"] && count($lists) >= 20) { + if ($post["all"] === "true") { $temp = []; $devices = Device::find()->all(); foreach ($devices as $key => $value) { @@ -548,7 +548,7 @@ class DeviceController extends Controller { Yii::$app->response->format = "json"; $post = Yii::$app->request->post(); $lists = $post["lists"]; - if ($post["all"] && count($lists) >= 20) { + if ($post["all"] === "true") { $temp = []; $devices = Device::find()->all(); foreach ($devices as $key => $value) { diff --git a/views/assign/index.tpl b/views/assign/index.tpl index e0369f16..28774f19 100644 --- a/views/assign/index.tpl +++ b/views/assign/index.tpl @@ -73,6 +73,9 @@ +
diff --git a/views/device/index.tpl b/views/device/index.tpl index e8f76871..c9911ecf 100644 --- a/views/device/index.tpl +++ b/views/device/index.tpl @@ -53,6 +53,9 @@ +
+ Chọn tất cả +