linyaostalker
5 years ago
5 changed files with 48 additions and 44 deletions
-
5backend/modules/goods/logic/goods/GoodsManager.php
-
20backend/modules/goods/migrations/m191209_091524_add_column_weight_in_table_atg_goods_sku.php
-
54backend/modules/goods/migrations/sql/update_goods.sql
-
5backend/modules/goods/models/ars/GoodsSku.php
-
8backend/modules/shop/controllers/ExpressTemplateController.php
@ -0,0 +1,20 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use yii\db\Migration; |
||||
|
|
||||
|
/** |
||||
|
* Class m191209_091524_add_column_weight_in_table_atg_goods_sku |
||||
|
*/ |
||||
|
class m191209_091524_add_column_weight_in_table_atg_goods_sku extends Migration |
||||
|
{ |
||||
|
public function up() |
||||
|
{ |
||||
|
$this->addColumn('atg_goods_sku', 'weight', $this->integer(8)->defaultValue("0")->unsigned()->comment('重量')); |
||||
|
} |
||||
|
|
||||
|
public function down() |
||||
|
{ |
||||
|
$this->dropColumn('atg_goods_sku', 'weight'); |
||||
|
return true; |
||||
|
} |
||||
|
} |
@ -1,37 +1,17 @@ |
|||||
DROP TABLE IF EXISTS `atg_goods`; |
|
||||
CREATE TABLE `atg_goods` ( |
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|
||||
`pid` int(11) DEFAULT NULL COMMENT '父级id', |
|
||||
`cat_id` int(11) NOT NULL COMMENT '后台商品类别id', |
|
||||
`brand_id` int(11) NOT NULL COMMENT '品牌id', |
|
||||
`shop_cat_id` int(11) NOT NULL COMMENT '前端商品类别id', |
|
||||
`name` varchar(120) NOT NULL COMMENT '商品名称', |
|
||||
`sn` varchar(60) DEFAULT NULL COMMENT '商品唯一货号', |
|
||||
`code` varchar(50) DEFAULT NULL COMMENT '商品货码', |
|
||||
`supplier_id` int(11) DEFAULT NULL COMMENT '供应商id', |
|
||||
`weight` mediumint(8) DEFAULT NULL unique COMMENT '重量', |
|
||||
`length` mediumint(8) DEFAULT NULL unique COMMENT '长度', |
|
||||
`width` mediumint(8) DEFAULT NULL unique COMMENT '宽度', |
|
||||
`height` mediumint(8) DEFAULT NULL unique COMMENT '高度', |
|
||||
`diameter` mediumint(8) DEFAULT NULL unique COMMENT '直径', |
|
||||
`unit` varchar(16) DEFAULT NULL COMMENT '单位', |
|
||||
`sold_count` int(10) DEFAULT NULL unique COMMENT '已售数量', |
|
||||
`limit_count` int(10) DEFAULT NULL COMMENT '限购数量', |
|
||||
`stock` int(10) DEFAULT NULL COMMENT '库存', |
|
||||
`stock_warn` int(10) DEFAULT NULL COMMENT '库存警告', |
|
||||
`market_price` int(20) DEFAULT NULL unique COMMENT '市场价', |
|
||||
`price` int(20) DEFAULT NULL unique COMMENT '销售价', |
|
||||
`brief` varchar(255) DEFAULT NULL COMMENT '简介', |
|
||||
`description` text COMMENT '详细介绍', |
|
||||
`image` int(11) DEFAULT NULL COMMENT '图片id', |
|
||||
`model_id` int(11) DEFAULT NULL COMMENT '模型id', |
|
||||
`is_sale` tinyint(1) DEFAULT '0' COMMENT '该商品是否开放销售,1为是,0为否', |
|
||||
`sort_order` smallint(3) DEFAULT NULL COMMENT '排序', |
|
||||
`bouns_points` mediumint(8) DEFAULT NULL COMMENT '奖励积分', |
|
||||
`experience_points` mediumint(8) DEFAULT NULL COMMENT '经验值', |
|
||||
`is_delete` tinyint(1) DEFAULT '0' COMMENT '是否删除,1为已删除', |
|
||||
`express_template` int(11) DEFAULT NULL COMMENT '配送详情id', |
|
||||
`created_at` int(10) DEFAULT '0' COMMENT '创建时间', |
|
||||
`updated_at` int(10) DEFAULT '0' COMMENT '更新时间', |
|
||||
PRIMARY KEY (`id`) |
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品表'; |
|
||||
|
ALTER TABLE `atg_goods` DROP `weight`; |
||||
|
ALTER TABLE `atg_goods` DROP `length`; |
||||
|
ALTER TABLE `atg_goods` DROP `width`; |
||||
|
ALTER TABLE `atg_goods` DROP `height`; |
||||
|
ALTER TABLE `atg_goods` DROP `diameter`; |
||||
|
ALTER TABLE `atg_goods` DROP `sold_count`; |
||||
|
ALTER TABLE `atg_goods` DROP `market_price`; |
||||
|
ALTER TABLE `atg_goods` DROP `price`; |
||||
|
|
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `weight` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '重量'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `length` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '长度'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `width` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '宽度'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `height` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '高度'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `diameter` mediumint(8) UNSIGNED DEFAULT NULL COMMENT '直径'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `sold_count` int(10) UNSIGNED DEFAULT NULL COMMENT '已售数量'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `market_price` int(20) UNSIGNED DEFAULT NULL COMMENT '市场价'; |
||||
|
ALTER TABLE `atg_goods` ADD COLUMN `price` int(20) UNSIGNED DEFAULT NULL COMMENT '销售价'; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue