diff --git a/backend/modules/goods/models/ars/Attribute.php b/backend/modules/goods/models/ars/Attribute.php index ad8870f..269510a 100755 --- a/backend/modules/goods/models/ars/Attribute.php +++ b/backend/modules/goods/models/ars/Attribute.php @@ -98,9 +98,12 @@ class Attribute extends \yii\db\ActiveRecord public function beforeSave($insert) { - if(!$this->type){ + if (!$this->type) { $this->type = self::TYPE_ATTR; } + if (!$this->sort_order) { + $this->sort_order = "999"; + } return parent::beforeSave($insert); // TODO: Change the autogenerated stub } diff --git a/backend/modules/goods/models/ars/Goods.php b/backend/modules/goods/models/ars/Goods.php index 723b35a..170c31d 100755 --- a/backend/modules/goods/models/ars/Goods.php +++ b/backend/modules/goods/models/ars/Goods.php @@ -238,7 +238,7 @@ class Goods extends \yii\db\ActiveRecord $this->limit_count = 0; } if (!$this->sort_order) { - $this->sort_order = 999; + $this->sort_order = "999"; } return parent::beforeSave($insert); // TODO: Change the autogenerated stub } diff --git a/backend/modules/goods/models/ars/ShopCategory.php b/backend/modules/goods/models/ars/ShopCategory.php index 3ec719c..0a00e89 100755 --- a/backend/modules/goods/models/ars/ShopCategory.php +++ b/backend/modules/goods/models/ars/ShopCategory.php @@ -126,6 +126,9 @@ class ShopCategory extends \yii\db\ActiveRecord if ($this->filter_attr != null && is_array($this->filter_attr)) { $this->filter_attr = implode(',', $this->filter_attr); } + if (!$this->sort_order) { + $this->sort_order = "999"; + } return parent::beforeSave($insert); // TODO: Change the autogenerated stub } }