diff --git a/config/params.php b/config/params.php index 035dbe6c..0f4d50fc 100644 --- a/config/params.php +++ b/config/params.php @@ -3,7 +3,7 @@ return [ "hideInfomation" => false, "TCTECH" => true, - "CardService" => "192.168.1.245:2001", + "CardService" => "192.168.10.200:2001", "time" => 1606755599, "pageSize" => 200 ]; diff --git a/config/web.php b/config/web.php index fc91d476..16d5c29b 100644 --- a/config/web.php +++ b/config/web.php @@ -48,7 +48,7 @@ $config = [ ], 'assetManager' => [ 'class' => 'app\\components\\AssetManager', - 'appendVersion' => '1.0.3', + 'appendVersion' => '1.0.5', 'bundles' => [ 'dmstr\web\AdminLteAsset' => [ 'skin' => 'skin-blue', diff --git a/controllers/AssignController.php b/controllers/AssignController.php index 03f938f7..28c98dc0 100644 --- a/controllers/AssignController.php +++ b/controllers/AssignController.php @@ -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"])) { diff --git a/helpers/StaffGrid.php b/helpers/StaffGrid.php index 3fdd25f1..1f16d3fa 100644 --- a/helpers/StaffGrid.php +++ b/helpers/StaffGrid.php @@ -93,7 +93,7 @@ class StaffGrid extends CommonGrid { if (isset($array[$value])) $doors[] = $array[$value]; } - if (count($ls) <= 2) { + if (count($doors) <= 2) { $alert = "