Browse Source

refactor:给排序字段默认值

antshop
linyaostalker 5 years ago
parent
commit
e846e149f4
  1. 3
      backend/modules/goods/models/ars/Attribute.php
  2. 2
      backend/modules/goods/models/ars/Goods.php
  3. 3
      backend/modules/goods/models/ars/ShopCategory.php

3
backend/modules/goods/models/ars/Attribute.php

@ -101,6 +101,9 @@ class Attribute extends \yii\db\ActiveRecord
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
}

2
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
}

3
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
}
}
Loading…
Cancel
Save