]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
фикс bug_smirnov_2025_02_19_fill_select2 origin/bug_smirnov_2025_02_19_fill_select2
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 19 Feb 2025 10:41:50 +0000 (13:41 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 19 Feb 2025 10:41:50 +0000 (13:41 +0300)
erp24/actions/grade/IndexAction.php
erp24/views/grade/index.php

index 5fb9f3b6bcdc82abb257f59c921dc44d3521a427..653ba7ff1fad582a9d98c930bd9d438bc0f3fc34 100755 (executable)
@@ -5,6 +5,7 @@ namespace yii_app\actions\grade;
 use Yii;
 use yii\base\Action;
 use yii\base\DynamicModel;
+use yii\db\Expression;
 use yii\helpers\ArrayHelper;
 use yii_app\records\Admin;
 use yii_app\records\AdminChats;
@@ -49,11 +50,9 @@ class IndexAction extends Action
 
         $admins = $adminsQuery->with(['position', 'adminGroup', 'store'])->andWhere(['>=', 'group_id', empty($searchModel->name) ? 0 : -1])->all();
 
-        $adminGroups = ArrayHelper::map(\yii_app\records\AdminGroup::find()->all(), 'id', 'name');
-        $adminGroups[0] = 'Не выбрано';
+        $adminGroups = [0 => 'Не выбрано'] + ArrayHelper::map(\yii_app\records\AdminGroup::find()->all(), 'id', 'name');
 
-        $stores = ArrayHelper::map(\yii_app\records\CityStore::find()->all(), 'id', 'name');
-        $stores[0] = 'Не выбрано';
+        $stores = [0 => 'Не выбрано'] + ArrayHelper::map(\yii_app\records\CityStore::find()->all(), 'id', 'name');
 
         $adminChats = ArrayHelper::map(AdminChats::find()->select(['admin_id'])->where(['state' => 2])->all(), 'admin_id', 'admin_id');
 
index 8353295c705f503831c2e053009ad740ee4b172b..39c0096faa8b50d4c31b5329ca270d60fcc36652 100755 (executable)
@@ -41,7 +41,7 @@ use kartik\select2\Select2;
             'language' => 'ru',
             'options' => ['placeholder' => 'Должность...'],
             'pluginOptions' => [
-                'allowClear' => true
+                'allowClear' => false
             ],
             'pluginEvents' => [
                 'change' => 'function(e) {
@@ -56,7 +56,7 @@ use kartik\select2\Select2;
             'language' => 'ru',
             'options' => ['placeholder' => 'Магазины...'],
             'pluginOptions' => [
-                'allowClear' => true
+                'allowClear' => false
             ],
             'pluginEvents' => [
                 'change' => 'function(e) {