laitimes

How "back-end" large-scale e-commerce companies design universal commodity centers

ï1/4éæ±

æ建ä ̧ä ̧ªçμåéç ̈yyyä ̧å¿ï1/4å ̄æ ̄æyçç§ç±»yy±æ§ùå¤ï1/4å ̄以å ç ãèæãä1/4åãæå¡ç±»yæ ̄ä ̧çyyy ·æä ̧åçè§æ 1/4ï1/4ä ̧çè§æ 1/4çåæ§ä"·æ 1/4çäçä©"·æ 1/4ï1/4å®® yy ̄æ ̄æ§è ̧çè ̧çæ ̄ä»ã

1ï1/4ç®çæ ̄ä»ä¹ï1/4

to ̧å§å¶ä ̧èμ·®to ðä ̧ä ̧ªéç ̈yyyä ̧å¿ï1/4ä"ä ̧å®°ä ̧äºæ©to±æ§è®3/4计æ³ã

2ï1/4ä1/2 è1/2å¦å°ä»ä¹ï1/4

  • §£è¡ä ̧æ ̄è ̄è¦å¿μ
  • ̈æskuè¡ ̈åè®3/4计
  • to±æskuæ©å±æ§è®3/4计
  • ä»·æ 1/4æ©å±æ§è®3/4计
  • yyè§æ 1/4è®3/4计

3ï1/4ä ̧è1/2å¦å°ä»ä¹ï1/4

  • yyy3/4çyy ̈è®3/4计
  • yyä ̧ä ̧æ¶è®3/4计
  • yyyæ ç3/4è 3/4è®®¡
  • åºåè 3/4è®®¡
  • æç ́¢çéè 3/4è®®¡

2 yyyūæ¦å¿μ

yyä ̧å¿æ ̄çμyyä ̧ªç³»ç»çæåºç¡åå ï1/4ä ̧ºyyã订åï1/4ä1/4æ ä¿éãúãä»to ̈ç æμç系穻æä3/4åºáæ°æ®ã

çμåçåºæ¬æ ̄è ̄ï1/4

  1. SKUï1/4ï1/4Stock Keeping Uintï1/4å³åºåéåä1/2ï1/4ï1/4åºyæ§å¶çæå°å ̄ç ̈yä1/2ãä3/4å¦âiPhone 7 Plus 128Gé¶è²âå°±æ ̄ä ̧ä ̧ªSKUï1/4ä»åºç¡çãéè® ́è¿è ́§ãåºç®¡çé1/2æ ̄以SKUäºè®°å1/2yy ã
  2. SPUï1/4ï1/4Standard Product Unitï1/4å³æ yyyú§yyy ï1/4ï1/4æ ̄ä ̧ç»æ yyä¿¡æ ̄çéåï1/4ä3/4å¦âiPhone 7 Plusâå°±æ ̄ä ̧ªSPUã
  3. ç±»ç ï1/4å³åç±»æ ãçμyy ̧ ̧çæä ̧¤å±ç±»ç ï1/4yy±çºç±»ç yyy« ̄yy类箮®ã®

    yðç±»ç æçæ ̄å±äºç»æ¶è ́¹è ççç±»ç®ï1/4ä1/4æ ¹æ ãèãéå®çåãæ®®́»to ̈è¿è¡y ̈ï1/4

    yyðç±»ç®å±äºç¡æ°æ ï1/4ä ̧å ̄éæy ̈ï1/4æ®·» to SKUæ¶é1/2éè¦éæ©yyŰç±»ç ï1/4è¿è¡ç®»to®ã

  4. to±æ§ï1/4åä ̧º óé å±æ§ãéå å±æ§ãé害鮮å±æ§ùæ®å±æ§ã
  • to ³é®å±æ§ æ ̄æè1/2å¤ ̄ä ̧á â ®®§å±æ§ï1/4æºçå¿ å¡¹ï1/4ä3/4å¦æºçå±oh¹Űºå ̧̄ãyy±äº to ±®æ§ã
  • éå å±æ§ æ ̄ç»æSKUç¹æ å±æ§ï1/4æç°ä ̧ºâçæ 1/4å±æ§âï1/4ä3/4宦æºçâ鮢è²âãâ åâã
  • éå ³é å±æçæ ̄é¤ ³é®®å±æ§ãéå å±æ§å§å§å ¶ä»å±æ§ï1/4å¦åç1/2 æè±¡å¤ ́åç ́ ãåç1/2®®æä¤ ́yç ́ 㺧宰ãåè3/4 ̈çã
  • ç¹æ®å±æ§ æéè¦éè¿è°ç ̈to ¶ä»æ¡æè1/2è·yyİçå±æ§ã

3 yyyæ¶æå3/4

åèä ̧é¢çåç»ææ ̈¡yy3/4ï1/4ååæ ̈¡åçç»æè3/4ä ̧ºå¤æï1/4å ̈å ä¹SKUä ̧SPUæ¶ï1/4æ¶åç±»ç ãå±æ§ãåçãçä§ä¿¡æ ̄çæ°æ çç®»yï1/4å ̈åºSKUyyy®"ºSPUï1/4å®̈SPUä ̧æ®·" to yy¿°yyæ 1/4æyy°±æºyyãæ ¹æ yyyyè¡çåºúää"·æ 1/4ç¡çãè ̄è ºçáçãæç®® ́¢çéçæ®̈¡®yã

3.1 yyyç»ææ ̈¡yyy3/4

How "back-end" large-scale e-commerce companies design universal commodity centers

3.2 yy ̧yſERy/4

How "back-end" large-scale e-commerce companies design universal commodity centers

3.3 yyyä ̧å¿æ ́ä1/2æ¶æå3/4

How "back-end" large-scale e-commerce companies design universal commodity centers

4 yyyç±»ç®

4.1 what±®®

yyç±»ç åä ̧ºä ̧¤å±ï1/4åºç¡æ°æ ç±»ç å±ï1/4yå°ç±»ç ï1/4ãyå°å±§ºç±»ç å±ï1/4yå°ð𠧱»ç ï1/4ãé£ä ̧ºä»ä¹è¦åãyy°ç±»ç yy1/4ç®®®®®¡çï1/4èä ̧æ®̄yİå ±ç ̈ä ̧å¥ç±»ç®®®âï1/4

yyy°ç±»ç é¢yyy¶æä3/4åºé3/4úºyï1/4yyy®±æ§ãéå å±æ§åçå3/4å¤æ°æ é1/2æ®̄å®̈yºç¡ç±»ç ä ̧è¿è¡ç®®¡çï1®/4

yyðç±»ç é¢yç ̈æ·ï1/4æ¹ä3/4¿ç ̈æ·æ¥æ3/4yyï1/4è¿å ̄以éçè¿è¦è¦å»èðæ ́ãæ ̄å¦èä ̧éçèæ¥ãæ¶ä»¤£èåï1/4è¿è¥1/4ç®»to ̧y ́yy°ç±»ç®ã

4.2 yyŰç±"ç®

yyy°ç±»ç ̧»®è¦é¢yy¹³y°¨¿è¥äººyyyy®¶ï1/4ç ̈äºç®¡çåã±æ§yyççæ°æ®ã

yyİç±»ç ̧ ̄¹åºå ï1/4á äºä¹åä ̧ä1/4è1 ®®/2»ææ ́æå é¤ï1/4å¦æç®±»ç®ä ̧æè1/21/2æåï1/4å°±ä ̧è1/2å éæä1/2åºã®

ç±"ç æ çå±æ¬¡ä ̧è1/2åªæ·±ï1/4ä ̧è¬ä ̧å±æyy±ãäªæ·±ï1/4å ̄¹äºyyç¡çä ̧太ª æ¹ä3/4¿ãç±»ç æ ä ̧æä ̧å±ç±»ç§°ä ̧ºå§±»ç ï1/4y¿ é¡»æè1/21/2äºå¶åç®®®±»ç®®®ä ̧ã

How "back-end" large-scale e-commerce companies design universal commodity centers

4.3 yyŰç±"ç®

yå°ç±»ç®ä ̧»è¦é¢åç ̈æ·ï1/4æ¹ä3/4¿ç ̈æ·çéæ¥æ3/4åï1/4å¦å3/4å3/4槺ã

yyðç±"ç to ̄ä"¥æ ¹æ è¥éè¦ï1/4çμæ ́»åäãæ以å¤çåçå箫 ̄ç±»ç æ¶ï1/4å°±åºè ̄¥æä3/4å¤æ ·åçåç« ̄类箮æ ̄æã®

yyİç±"ç ̄æ ̧yyyĢæ®·ç« ̄çè®3/4ç1/2®ãPCç« ̄ãH5ç« ̄ãAPP箫 ̄ç

yyy°ç±»ç ä ̧yúyź çyİç®®±»ç ï1/4ç1/4è3/4å3/4çμæ®́»ãå ̄éå é¤ãå ̄éæ¶yå ̈ï1/4å®æ¶çæã

How "back-end" large-scale e-commerce companies design universal commodity centers

4.4 ç±»ç®è¡ ̈ç»æè 3/4è®®¡

4.1.1 åç« ̄ç±»ç®è¡ ̈è 3/4è®®¡

CREATE TABLE `category` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `name` varchar(32) NOT NULL COMMENT '类目名称',
 `parent_id` bigint(11) NOT NULL COMMENT '父id',
 `leaf` tinyint(4) NOT NULL COMMENT '是否叶子节点 1是 0不是',
 `level` tinyint(4) NOT NULL COMMENT '类目层级',
 `path` varchar(128) DEFAULT NULL COMMENT '完整父级路径:父父id_父id',
 `sort` int(11) unsigned NOT NULL COMMENT '排序字段',
 `status` tinyint(4) NOT NULL COMMENT '分类状态:1上架 2下架',
 `del` tinyint(4) unsigned NOT NULL COMMENT '是否删除',
 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='类目表';           

4.4.2 åç« ̄ç±»ç®æ°æ®å±§º

How "back-end" large-scale e-commerce companies design universal commodity centers

5 SKU

SKUç æ ̄çμyä®̧æºçæ¦å¿μï1/4SKUæ ̄æºy ã

以iPhone 8 Plusï1/4SPUï1/4ä ̧ºä3/4ï1/4è¿ä ̧ªSPUçè§æ 1/4æå¤ç§ï1/4é¢è²å å«é è²ãç1/2è²ãé»è²ãç«ç°éé¶è²ãää�ãääº é»ã纮¢è²ç6ç§ï1/4å åå å«32Gã 128Gã256Gç3ç§ï1/4ï1/4å ̄¹åº18ï1/4å³3Ã6ï1/4ç§SKUãæ ̄å¦âiPhone 7 Plusç1/2 è²32GâãâiPhone 7 Plusé»è²32Gâè¿ä ̧¤ä ̧ªSKUé1/2è1/2å ·åå°å®ç ãä»åºç³»ç»ç»ãéè ́ç³»ç»ãåºåç³»ç»ç³»ç©»é1/2æ ̄ä ̧»è¦ç®¡çSKUã

5.1 skuè¡ ̈è®3/4计

CREATE TABLE `sku` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `sku_no` varchar(32) DEFAULT '' COMMENT '商品序列号',
 `sku_name` varchar(50) DEFAULT NULL COMMENT '商品名称',
 `sku_description` varchar(256) DEFAULT NULL COMMENT '商品描述',
 `sku_type` tinyint(4) DEFAULT NULL COMMENT '商品类型:1实物商品、2会员商品、3增值商品,4虚拟物品',
 `status` tinyint(4) NOT NULL COMMENT '状态 1未上架2.已上架 3.已下架',
 `sort` int(10) DEFAULT '0' COMMENT '排序',
 `boundle` tinyint(4) unsigned DEFAULT '0' COMMENT '是否组合商品 1是 0否',
 `create_by` int(11) unsigned NOT NULL COMMENT '创建人ID',
 `update_by` int(11) unsigned DEFAULT NULL COMMENT '修改人ID',
 `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY(`id`) USING BTREE,
  UNIQUE KEY `uk_sku_no` (`sku_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '商品表'           

5.2 skuè¡ ̈æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

5.3 skuå±æ§è¡ ̈

©æ å±æ§1ï1/4å ̈ææ éå¶yå"ºå±æ§æ°éã

CREATE TABLE `sku_attr` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `sku_no` varchar(32) DEFAULT '' COMMENT '商品序列号',
 `sku_attrs` json DEFAULT NULL COMMENT 'sku属性(商品属性)',
 `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY(`id`) USING BTREE,
  UNIQUE KEY `uk_sku_no` (`sku_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '商品属性表'           

5.4 skuå±æ§æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

ä ̧yy»ºæ°åæ μï1/4è¿å ̄以ç ̈sql殥è ̄¢ï1/4ä1/2 å3/4å°äºä»ä¹å ̄åï1/4

5.5 See ̈æè¡ ̈å

©æ å±æ§2ï1/4æ ¹æ ä ̧åç±»ç®è1/21/2ä ̧yy±æ ̧æ ̈æ计 ̈åã

How "back-end" large-scale e-commerce companies design universal commodity centers

å°ä ̧ç»å±æ§æè1/21/2å°ç±»ç®æ¥å ̈æè¡ ̈åï1/4ä1/2 å3/4å°úä»ä¹å ̄åï1®/4

5.6 yyyç±»ç®óè

CREATE TABLE `category_to_goods` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `category_id` bigint(20) DEFAULT NULL COMMENT '类目id',
 `goods_no` varchar(32) DEFAULT NULL COMMENT '商品编号',
 `goods_type` tinyint(4) DEFAULT NULL COMMENT '商品类型:1sku、2spu',
 `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
 `is_deleted` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除:0-否,1-是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COMMENT='类目商品关联表';           

5.7 ç»åskuå ³ç³»è¡ ̈

CREATE TABLE `bundle_to_sku` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `goods_id` bigint(20) DEFAULT NULL COMMENT '商品id, 组合商品id',
 `bundle_id` bigint(20) DEFAULT NULL COMMENT '组合商品id',
 `quantity` int(11) DEFAULT NULL COMMENT '商品数量',
 `entity_type` tinyint(4) DEFAULT '1' COMMENT '商品的类型:1sku,2组合商品',
 `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
 `is_deleted` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除:0-否,1-是',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_bundle_to_goods_bundle_id_index` (`bundle_id`) USING BTREE,
  KEY `idx_bundle_to_goods_object_id_entity_type_index` (`object_id`,`entity_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='套装和sku关联表||套装和spu关联表';
           

5.8 ç»Åskuå ³ç³»æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

Skua® æ

How "back-end" large-scale e-commerce companies design universal commodity centers

5.9 yy"ºç»yyy¡ ̈å

How "back-end" large-scale e-commerce companies design universal commodity centers

6 to±æ§

6.1 to±æ§§®¡ç

ä ̧ºúæ¹ä3/4¿yyç¡çï1/4æ们éè¦to ̈ç³»ç»ä ̧建ç«ä ̧å¥å±æ§åºãå ̈to®ä¹ä ̧ä ̧ªå±æ§æ¶ï1/4éè¦æè1/21/2å ̈类箮 ä ̧ï1/4åºy±æ§åç±»ï1/4å ³é å±æ§ãéå å±æ§ãéå ³é®®å±æ§ãùæ®å±æ§ï1/4ï1/4容¶ç¡ ®®å± æ§å1/4ãæ3/4äºç±»yï1/4åéãå¤éãå ̄èªå®ä¹ï1/4ãæ ̄yŦyš«ã

How "back-end" large-scale e-commerce companies design universal commodity centers

6.2 to±æ§úç ̈åºæ ̄

  1. æ·" to yyá ̈yæ ̧²æã ̈æ·" to yyyæ¶ï1/4å ̄éè¿éæ å¶åç±»ç®ï1/4å°æè1/21/2å°å¶ç±»çå®±æ§æ ̧²æ©°á ̈y̧ã
  2. to ́æ®·ç« ̄¹to ̄æ äæ®ä ̧å±æ§è¿è¡æç ́¢ãçéyyã
  3. to ̈spué¡μé¢ç ̈æ·å ̄å ̈yyè§æ 1/4(éå å±æ§)æ¥å ä1/2åºä©®®̧åçskuã
  4. yyy ̄¦æ é¡μé¢ ̄å±äyyŰé ç1/2®çå±æ°æ°æ®â
How "back-end" large-scale e-commerce companies design universal commodity centers

6.3 å±æ§è¡ ̈è 3/4è®®¡

CREATE TABLE `attribute` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `name` varchar(32) NOT NULL DEFAULT '' COMMENT '属性名称',
 `code` varchar(32) DEFAULT NULL COMMENT '属性代码(非必填)',
 `attr_type` tinyint(4) NOT NULL COMMENT '属性应用:1商品属性,2销售属性,3特殊属性',
 `value_type` tinyint(4) DEFAULT NULL COMMENT '属性值类型:1:字符串,2:数字',
 `fill_type` tinyint(4) NOT NULL COMMENT '填写类型:1填写型(字符),2填写型(仅整数数字),3选择型(单选值,非id)4选择型(多选值,非id),5多输入框展示型',
 `is_filter` tinyint(4) unsigned NOT NULL COMMENT '是否支持前台筛选:0否 1是',
 `status` tinyint(11) NOT NULL COMMENT '状态:1 未上架 2已上架 3已下架',
 `is_deleted` tinyint(4) unsigned NOT NULL COMMENT '是否删除',
 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='属性表';           

6.4 to±æ§á ̈æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

6.5 å±æ§æä ̧3/4è¡ ̈è®3/4计

CREATE TABLE `attribute_enum` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `attr_id` bigint(20) NOT NULL COMMENT '属性id',
 `attr_code` varchar(32) DEFAULT NULL,
 `enum_code` bigint(11) DEFAULT NULL COMMENT 'enumcode',
 `enum_value` varchar(32) NOT NULL COMMENT '属性枚举值名称',
 `sort` int(11) NOT NULL COMMENT '排序',
 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='属性枚举表';           

6.6 å±æ§æä ̧3/4è¡ ̈æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

6.7 to±æ§åç±»ç®óèè¡ ̈è®3/4计

CREATE TABLE `category_to_attr` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `category_id` bigint(11) NOT NULL COMMENT '分类id',
 `attr_id` bigint(20) NOT NULL COMMENT '属性id',
 `is_required` tinyint(4) unsigned NOT NULL COMMENT '是否必填',
 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分类属性关联表';           

6.8 to ̈æçæ±æ§è¡ ̈å

å1/2å±æ§åºæ建å æåï1/4å°±ä1/4被åçªå¶åç®±»ç®̈ï1/4æ·" to yyyöå°±éè¦å¡«y¿äºå±æ§ï1/4y°±æºè1/21/2ä1/2ï1/4å¦å3/4æºã

How "back-end" large-scale e-commerce companies design universal commodity centers

æ ¹æ è¿äºå±æ§ä3/4¿è1/2ç¡å yyçå ̄ä ̧æ§ï1/4SKUï1/4ã çyy®±æ§ï1/4类箮®âç·è£ âââé£á£âï1/4 , ç¹å«éè¦æ³ ̈æçæ ̄ä ̧äºçæ®1/4å±æ§ï1/4å¦é¢è²ãðºç çï1/4ãå3/4大åæ 1/4â§æ 1/4â3/4å¦á£ æãéåçã以ä ̧åç·éä ̧ºä3/4ï1/4æé¢è²ï1/4åè®3/4ç1/2㺢ã é»3ç§é¢è²ï1/4ï1/4æå°ºç ï1/4ä»39ï1/244å ±6ç§å°ºç ï1/4ï1/4é£ä¹è¿ä ̧ªSPUï1/4ç·éï1/4 ä ̧é¢å°±æ18ä ̧ªSKUãè¿äºSKUçå±æ§é¤ºçæ 1/4å±æ§å¤ï1/4å ¶ä»å±æ§é1/2æ ̄ ä ̧ è ́çï1/4æ以å ̈æ°å»ºyyæ¶ï1/4å ̄èyy°ä ̧èμ·ï1/4å ±̈å ¶ä»å±æ§ã

7 SPU

7.1 SPUe¦μ

SPU ̄æ y ãSPUä ̧SKUçå ³ç³»æè ̧å§ï1/4å ̄以ä̧å ̄¹äçä ̧â ̧ï1/4 ç»å§é ̈åSPUä ̧SKUé1/2æ ̄ä ̧å ̄¹ä ̧ï1/4娧æ 1/4çSPUåSKUä¹é ́æ ̄éè¿è®§æ 1/4å±æ§æ¿æ¥çãSPUçåºyy ̄ç±to ¶y ̄¹çSKUyy ±y³y®ç 。

How "back-end" large-scale e-commerce companies design universal commodity centers

以iPhone 11ï1/4SPUï1/4ä ̧ºä3/4ï1/4è¿ä ̧ªSPUçè§æ 1/4æå¤ç§ï1/4é¢è²å å«ç1/2è²ãé»è²ãé»éãç»è²ã绿è²ã红è²ç²çòçãç¥ç²çòοβãç¥ç²ãç¥ç¥ç²ãç¥ç¥ç²ãç¥ç¥ç²ãç¥ç¥ç¥ç²ãç¥ç¥ç²ãç¥ç²ã笲ãç¥ç²ãç²ã笲ãç²ãç¥ç²ãç²ãç¥ç²ãç²ã6ç§ï1/4å åå å«32Gã 128Gã256Gç3ç§ï1/4ï1/4å ̄¹åº18ï1/4å³3Ã6ï1/4ç§SKUãæ ̄å¦âiPhone 11 ç1/2è² 64GâãâiPhone 11 é»è² 64Gâ è¿ä ̧¤ä ̧ªSKUé1/2è1/2å ·åå°å ç ãä»åºç³»ç»ãéè́ç³»ç»ãåºåç³»ç»ç»ç系穻é1/2æ ̄ä ̧»è¦ç®¡çSKUã å ̈æ¥å ̧ ̧è¿è¥ä ̧ä¹å3/4å ̧ ̧è§ä ̧ä ̧ªSKUå ̄¹åºå®¤ä ̧ªSPUã

How "back-end" large-scale e-commerce companies design universal commodity centers

7.2 SPUåè§æ 1/4è 3/4è®®¡

CREATE TABLE `spu` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `name` varchar(64) DEFAULT NULL COMMENT 'spu名称',
 `detail` varchar(256) DEFAULT NULL COMMENT '商品介绍',
 `status` tinyint(4) DEFAULT NULL COMMENT '状态 1未上架2.已上架 2.已下架',
 `spu_specs` json DEFAULT NULL COMMENT '商品规格',
 `creator_id` bigint(20) DEFAULT NULL COMMENT '创建者',
 `is_deleted` tinyint(1) unsigned DEFAULT '0' COMMENT '是否删除,0:未删除 1:已删除',
 `sort` int(10) DEFAULT '0' COMMENT '排序',
 `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='spu';           

7.3 SPUåè§æ 1/4æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

skuå±æ§æ°æ®

How "back-end" large-scale e-commerce companies design universal commodity centers

Spuè¡ ̈yy3/4ç

How "back-end" large-scale e-commerce companies design universal commodity centers

7.4 spuåskuå ³èè¡ ̈

CREATE TABLE `spu_to_sku` (
 `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
 `sku_no` varchar(32) NOT NULL DEFAULT '' COMMENT 'sku id',
 `spu_no` varchar(32) NOT NULL DEFAULT '' COMMENT 'spu id',
 `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除,0:未删除 1:已删除',
 `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_spu_to_sku` (`spu_no`,`sku_no`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='spu商品关联表';           

8 ä»·æ 1/4is®3/4计

ä»·æ 1/4å æ¬ï1/4ææ¬ä»·ãåä»·ãå åä»·ãå éãè ̈èéçä1/4éçéæ±çä ̧æå¢å ï1/4å°¤å ¶æ ̄ä ̧äºå ̈线æ²çåç ́è¡ä ̧çμyå®®̄¹éé¢ä1/4æç§ç©æ³ã

CREATE TABLE `sku_price` (
 `id` bigint(11) NOT NULL AUTO_INCREMENT,
 `sku_id` bigint(11) unsigned NOT NULL COMMENT '商品id',
 `sku_no` varchar(20) NOT NULL DEFAULT '' COMMENT '商品编号',
 `sku_type` tinyint(4) NOT NULL COMMENT '商品类型: 1单sku 2组合sku',
 `sub_goods` tinyint(4) NOT NULL COMMENT '是否子商品:0否1是',
 `bundle_id` bigint(20) DEFAULT NULL COMMENT '组合商品id 默认 空',
 `price` decimal(10, 2) NOT NULL COMMENT 'ä»·æ ¼',
 `price_type` varchar(32) NOT NULL COMMENT '价格类型枚举(1.商品原价REAL_PRICE 2.售卖价SELL_PRICE 3.售卖底价... )',
 `currency_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '货币类型:1人民币 2虚拟币',
 `enable` tinyint(4) unsigned DEFAULT '1' COMMENT '是否启用 0 不启用 1  启用',
 `create_by` int(11) unsigned NOT NULL COMMENT '创建人ID',
 `update_by` int(11) unsigned DEFAULT NULL COMMENT '修改人ID',
 `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
 `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_sku_id` (`sku_id`) USING BTREE,
  KEY `idx_sku_no` (`sku_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '商品价格表' "           

©æ å±æ§3ï1/4ä ̧y建æ°yy μï1/4åä ̧ä ̧ªyyy®̄æ ̄æ¤ç§ä»·æ 1/4åè ́§ççç±"

9 æ»ç»

æ¬æè ̄¦ç»ä»ç»äºyyä ̧å¿è 3/4è¡æ å±æ§è 3/4è¡æ³ï1/4并y ̈è®®®3/4è®®®¡æ©¹é¢äºyç" ́šº¦yã

©æ å±æ§æ»ç»å¦ä ̧ï1/4

  • to ̈æ éy"ºå±æ§æ°éã
  • æ äæ ä ̧yç±»ç®è1/21/2ä ̧yy±æ ̧æ ̈æ计 ̈yã
  • ä ̧yy»ºæ°yæ μï1/4åä ̧ä ̧ªyyy ̄æ ̄殤ç§ä»·æ 1/4yy ́§ççç±»ã

to to±æ§æ³å ̄ä"§è å§å±¶©å ̄ä"§®©å®¶å ̈y1/4yè¿ç ̈äæå ̄yã

æç« æ¥æºï1/4京ä ̧ç©æμ_é«å³°_https://zhuanlan.zhihu.com/p/618405659