|
@ -77,7 +77,7 @@ class Goods extends \yii\db\ActiveRecord |
|
|
const IS_EXPRESS_YES = 1; //是
|
|
|
const IS_EXPRESS_YES = 1; //是
|
|
|
//快递运费计算方式express_type
|
|
|
//快递运费计算方式express_type
|
|
|
const EXPRESS_TYPE_UNIFORM_POSTAGE = 1; //统一邮费
|
|
|
const EXPRESS_TYPE_UNIFORM_POSTAGE = 1; //统一邮费
|
|
|
const EXPRESS_TYPE_EXPRESS_TEMPLAGE = 2; //运费模板
|
|
|
|
|
|
|
|
|
const EXPRESS_TYPE_EXPRESS_TEMPLATE = 2; //运费模板
|
|
|
|
|
|
|
|
|
public static $isTaking = [ |
|
|
public static $isTaking = [ |
|
|
self::IS_TAKING_NO => '否', |
|
|
self::IS_TAKING_NO => '否', |
|
@ -89,7 +89,7 @@ class Goods extends \yii\db\ActiveRecord |
|
|
]; |
|
|
]; |
|
|
public static $expressType = [ |
|
|
public static $expressType = [ |
|
|
self::EXPRESS_TYPE_UNIFORM_POSTAGE => '统一邮费', |
|
|
self::EXPRESS_TYPE_UNIFORM_POSTAGE => '统一邮费', |
|
|
self::EXPRESS_TYPE_EXPRESS_TEMPLAGE => '运费模板' |
|
|
|
|
|
|
|
|
self::EXPRESS_TYPE_EXPRESS_TEMPLATE => '运费模板' |
|
|
]; |
|
|
]; |
|
|
public static $isSale = [ |
|
|
public static $isSale = [ |
|
|
self::IS_SALE_NO => '不在售', |
|
|
self::IS_SALE_NO => '不在售', |
|
@ -128,7 +128,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'], |
|
@ -138,7 +138,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'] |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|