Browse Source

refactor:后台商品分类排序增加默认值

antshop
linyaostalker 5 years ago
parent
commit
2dc5dad410
  1. 8
      backend/modules/goods/models/ars/Category.php

8
backend/modules/goods/models/ars/Category.php

@ -112,4 +112,12 @@ class Category extends \yii\db\ActiveRecord
{ {
return $this->hasOne(File::className(), ['id' => 'icon']); 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
}
} }
Loading…
Cancel
Save