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() ?>