|
|
@@ -62,6 +62,7 @@ class ShopGoodsForm extends Model
|
|
|
[['selectedIds'], 'isSelected'],
|
|
|
[['sort'], 'isSort'],
|
|
|
[['sellDiscount'], 'isDiscount'],
|
|
|
+ [['pricePv', 'sellPriceStandard'], 'isPrice'],
|
|
|
];
|
|
|
}
|
|
|
|
|
|
@@ -173,6 +174,17 @@ class ShopGoodsForm extends Model
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function isPrice($attributes)
|
|
|
+ {
|
|
|
+ if ($this->pricePv <= 0) {
|
|
|
+ $this->addError($attributes, \Yii::t('ctx', 'pvMustGreaterThanZero'));
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($this->sellPriceStandard <= 0) {
|
|
|
+ $this->addError($attributes, \Yii::t('ctx', 'sellPriceStandardMustGreaterThanZero'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
* @return ShopGoods|null
|