|
@ -110,7 +110,7 @@ class Goods extends \yii\db\ActiveRecord |
|
|
public function rules() |
|
|
public function rules() |
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
[['pid', 'cat_id', 'brand_id', 'shop_cat_id', 'supplier_id', 'weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'limit_count', 'stock', 'stock_warn', 'market_price', 'price', 'image', 'model_id', 'is_sale', 'sort_order', 'bouns_points', 'experience_points', 'is_delete', 'express_template', 'sku_mode', 'is_taking', 'is_express', 'express_type'], 'integer'], |
|
|
|
|
|
|
|
|
[['pid', 'cat_id', 'brand_id', 'shop_cat_id', 'supplier_id', 'weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'limit_count', 'stock', 'stock_warn', 'image', 'model_id', 'is_sale', 'sort_order', 'bouns_points', 'experience_points', 'is_delete', 'express_template', 'sku_mode', 'is_taking', 'is_express', 'express_type'], 'integer'], |
|
|
[['cat_id', 'brand_id', 'shop_cat_id', 'name'], 'required'], |
|
|
[['cat_id', 'brand_id', 'shop_cat_id', 'name'], 'required'], |
|
|
[['sn'], 'checkExist'], |
|
|
[['sn'], 'checkExist'], |
|
|
[['description', 'coverImageId', 'detailImageId'], 'string'], |
|
|
[['description', 'coverImageId', 'detailImageId'], 'string'], |
|
@ -120,7 +120,7 @@ class Goods extends \yii\db\ActiveRecord |
|
|
[['unit'], 'string', 'max' => 16], |
|
|
[['unit'], 'string', 'max' => 16], |
|
|
[['brief'], 'string', 'max' => 255], |
|
|
[['brief'], 'string', 'max' => 255], |
|
|
[['weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'market_price', 'price', 'uniform_postage'], 'checkNegative'], |
|
|
[['weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'market_price', 'price', 'uniform_postage'], 'checkNegative'], |
|
|
[['uniform_postage'], 'safe'] |
|
|
|
|
|
|
|
|
[['uniform_postage', 'market_price', 'price'], 'safe'] |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|