From: Alexander Smirnov Date: Wed, 19 Feb 2025 10:41:50 +0000 (+0300) Subject: фикс X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=8470a9ff05e353dcd4937802063182eca57c302d;p=erp24_rep%2Fyii-erp24%2F.git фикс --- 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) {