diff --git a/backend/modules/goods/models/ars/Category.php b/backend/modules/goods/models/ars/Category.php index 16bf72f..e32fd7c 100755 --- a/backend/modules/goods/models/ars/Category.php +++ b/backend/modules/goods/models/ars/Category.php @@ -112,4 +112,12 @@ class Category extends \yii\db\ActiveRecord { return $this->hasOne(File::className(), ['id' => 'icon']); } + + public function beforeSave($insert) + { + if (!$this->sort_order) { + $this->sort_order = "999"; + } + return parent::beforeSave($insert); // TODO: Change the autogenerated stub + } }