update gán lịch trình toàn bộ
This commit is contained in:
@@ -78,7 +78,7 @@ class AssignController extends Controller {
|
||||
$searchModel = new StaffSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
$dataProvider->query->andFilterWhere(['OR', ["LIKE", "name", $post['key']], ["LIKE", "code", $post['key']]]);
|
||||
$dataProvider->pagination->pageSize = 200;
|
||||
$dataProvider->pagination->pageSize = Yii::$app->params["pageSize"];
|
||||
|
||||
return $this->renderAjax("staff", [
|
||||
'searchModel' => $searchModel,
|
||||
@@ -93,7 +93,13 @@ class AssignController extends Controller {
|
||||
public function actionSetSchedule() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
$lists = Staff::find()->andWhere(["IN", "id", $post["staffs"]])->all();
|
||||
if ($post['currentDepartment'] !== "" && count($post["staffs"]) >= Yii::$app->params["pageSize"]) {
|
||||
$model = new Department();
|
||||
$childs = $model->departmentChilds($post["currentDepartment"]);
|
||||
$lists = Staff::find()->andWhere(["IN", "department_id", $childs])->all();
|
||||
} else {
|
||||
$lists = Staff::find()->andWhere(["IN", "id", $post["staffs"]])->all();
|
||||
}
|
||||
foreach ($lists as $key => $value) {
|
||||
$value->schedule_id = $post["schedule"];
|
||||
if ($value->door_access !== json_encode($post["doors"])) {
|
||||
|
||||
Reference in New Issue
Block a user