From 3f8f09bf36a5a95c11338dc80397d5618728e363 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Sat, 7 Dec 2019 10:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=A8=A1=E5=9E=8B=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=98=AF=E5=90=A6=E8=87=AA=E6=8F=90,=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=BF=AB=E9=80=92=E5=8F=91=E8=B4=A7,=E5=BF=AB?= =?UTF-8?q?=E9=80=92=E8=BF=90=E8=B4=B9=E6=96=B9=E5=BC=8F,=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E9=82=AE=E8=B4=B9=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/models/ars/Goods.php | 40 +++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/backend/modules/goods/models/ars/Goods.php b/backend/modules/goods/models/ars/Goods.php index beaa058..7ec96dc 100755 --- a/backend/modules/goods/models/ars/Goods.php +++ b/backend/modules/goods/models/ars/Goods.php @@ -47,6 +47,10 @@ use backend\modules\goods\models\ars\Supplier; * @property int $created_at 创建时间 * @property int $updated_at 更新时间 * @property int $sku_mode sku类型 + * @property int $is_taking 是否自提 + * @property int $is_express 是否快递发货 + * @property int $express_type 快递运费方式 + * @property int $uniform_postage 统一邮费 */ class Goods extends \yii\db\ActiveRecord { @@ -62,9 +66,31 @@ class Goods extends \yii\db\ActiveRecord //该商品是否开放销售is_sale const IS_SALE_NO = 0;//否 const IS_SALE_YES = 1;//是 - //sku类型 + //类型sku const SKU_MODE_ATTR = 1;//SKU类型属性 const SKU_MODE_MANUAL = 2;//SKU类型手写 + //是否自提is_taking + const IS_TAKING_NO = 0; //否 + const IS_TAKING_YES = 1; //是 + //是否快递发货is_express + const IS_EXPRESS_NO = 0; //否 + const IS_EXPRESS_YES = 1; //是 + //快递运费计算方式express_type + const EXPRESS_TYPE_UNIFORM_POSTAGE = 1; //统一邮费 + const EXPRESS_TYPE_EXPRESS_TEMPLAGE = 2; //运费模板 + + public static $isTaking = [ + self::IS_TAKING_NO => '否', + self::IS_TAKING_YES => '是' + ]; + public static $isExpress = [ + self::IS_EXPRESS_NO => '否', + self::IS_EXPRESS_YES => '是' + ]; + public static $expressType = [ + self::EXPRESS_TYPE_UNIFORM_POSTAGE => '统一邮费', + self::EXPRESS_TYPE_EXPRESS_TEMPLAGE => '运费模板' + ]; public static $isSale = [ self::IS_SALE_NO => '不在售', self::IS_SALE_YES => '在售' @@ -84,7 +110,7 @@ class Goods extends \yii\db\ActiveRecord public function rules() { 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'], 'integer'], + [['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'], [['cat_id', 'brand_id', 'shop_cat_id', 'name'], 'required'], [['sn'], 'checkExist'], [['description', 'coverImageId', 'detailImageId'], 'string'], @@ -93,7 +119,8 @@ class Goods extends \yii\db\ActiveRecord [['code'], 'string', 'max' => 50], [['unit'], 'string', 'max' => 16], [['brief'], 'string', 'max' => 255], - [['weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'market_price', 'price'], 'checkNegative'], + [['weight', 'length', 'width', 'height', 'diameter', 'sold_count', 'market_price', 'price', 'uniform_postage'], 'checkNegative'], + [['uniform_postage'], 'safe'] ]; } @@ -164,9 +191,14 @@ class Goods extends \yii\db\ActiveRecord 'bouns_points' => '奖励积分', 'experience_points' => '经验值', 'is_delete' => '是否删除,1为已删除', - 'express_template' => '配送详情id', + 'express_template' => '配送详情', 'created_at' => '创建时间', 'updated_at' => '更新时间', + 'sku_mode' => 'sku类型', + 'is_taking' => '是否自提', + 'is_express' => '是否快递发货', + 'express_type' => '快递运费方式', + 'uniform_postage' => '统一邮费', ]; }