From e846e149f42ff1e1eab79ae1fa7fd08396e8bc5e Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Fri, 13 Dec 2019 09:55:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E7=BB=99=E6=8E=92=E5=BA=8F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/models/ars/Attribute.php | 5 ++++- backend/modules/goods/models/ars/Goods.php | 2 +- backend/modules/goods/models/ars/ShopCategory.php | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) 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 } }