From 2c62043bb0dc6624858a3ec8a42a142127d88d72 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 10 Dec 2019 16:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/models/ars/Category.php | 4 ++-- backend/modules/goods/views/category/_form.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/modules/goods/models/ars/Category.php b/backend/modules/goods/models/ars/Category.php index 7831e78..827ec36 100755 --- a/backend/modules/goods/models/ars/Category.php +++ b/backend/modules/goods/models/ars/Category.php @@ -102,9 +102,9 @@ class Category extends \yii\db\ActiveRecord * @return array * 数据键值对 */ - public static function modelColumn($model) + public static function modelColumn() { - return $column = self::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->andWhere(['!=', 'id', $model->id])->indexBy('id')->column(); + return $column = self::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->indexBy('id')->column(); } public function getIconFile() diff --git a/backend/modules/goods/views/category/_form.php b/backend/modules/goods/views/category/_form.php index e6b4713..87b09b9 100755 --- a/backend/modules/goods/views/category/_form.php +++ b/backend/modules/goods/views/category/_form.php @@ -17,7 +17,7 @@ use backend\modules\goods\models\ars\Category; field($model, 'name')->textInput(['maxlength' => true]) ?> - field($model, 'pid')->dropDownList(array_merge([0 => '一级分类'], Category::modelColumn($model))) ?> + field($model, 'pid')->dropDownList(array_merge([0 => '一级分类'], Category::modelColumn())) ?> field($model, 'sort_order')->textInput() ?>