From 8470a9ff05e353dcd4937802063182eca57c302d Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 19 Feb 2025 13:41:50 +0300 Subject: [PATCH] =?utf8?q?=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/grade/IndexAction.php | 7 +++---- erp24/views/grade/index.php | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/erp24/actions/grade/IndexAction.php b/erp24/actions/grade/IndexAction.php index 5fb9f3b6..653ba7ff 100755 --- a/erp24/actions/grade/IndexAction.php +++ b/erp24/actions/grade/IndexAction.php @@ -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'); diff --git a/erp24/views/grade/index.php b/erp24/views/grade/index.php index 8353295c..39c0096f 100755 --- a/erp24/views/grade/index.php +++ b/erp24/views/grade/index.php @@ -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) { -- 2.39.5