Sfoglia il codice sorgente

complete v1.0 product db design

huodongdong 7 anni fa
parent
commit
3d118dfde8

+ 20 - 0
db/lj_combo.md

@@ -0,0 +1,20 @@
+### lj_combo table structure
+> 此表为课程存储对应的数据结构
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| merchant_id | bigint | no | | 渠道id | |
+| name | varchar(1024) | yes | null | 课程名 | |
+| digest | text | yes | null | 课程摘要 | |
+| cv_img_ids | varchar(512) | yes | null | 封面图 | |
+| cost_price | double(16,2) | no | 0 | 成本价 | |
+| sale_price | double(16,2) | no | 0 | 渠道价格 | |
+| market_price | double(16,2) | no | 0 | 终端价格 | |
+| status | smallint | no | | 状态 | |
+| create_time | smallint | no | now | 创建时间 | |
+| update_time | timestamp | no | now | 更新时间 | | |
+
+##### index
+> index merchant_id

+ 13 - 0
db/lj_combo_item_relation.md

@@ -0,0 +1,13 @@
+### lj_combo_item_relation table structure
+> 此表为课程包与商品的对应关系表
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| combo_id | bigint | no | | | |
+| item_id | bigint | no | | | |
+| create_time | timestamp | no | now | 创建时间 | | |
+
+##### index
+> unique index (combo_id, item_id)

+ 16 - 0
db/lj_combo_price.md

@@ -0,0 +1,16 @@
+### lj_combo_price table structure
+> 此表为课程包的出售价格
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| combo_id | bigint | no | | 课程包id | |
+| type | int | no | | 类型 | |
+| price | double(16,2) | no | 0 | 价格 | |
+| status | smallint | no | | 状态 | |
+| create_time | smallint | no | now | 创建时间 | |
+| update_time | timestamp | no | now | 更新时间 | | |
+
+##### index
+> index item_id

+ 15 - 0
db/lj_course_lesson_relation.md

@@ -0,0 +1,15 @@
+### lj_course_lesson_relation table structure
+> 此表为课程与课的对应关系的数据结构
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| cid | varchar(512) | no | | 课程编码 | |
+| lid | varchar(512) | no | | 课程编码 | |
+| merchant_id | bigint | no | | 渠道id | |
+| status | smallint | no | | 状态 | |
+| create_time | smallint | no | now | 创建时间 | | |
+
+##### index
+> unique index on(cid, lid, merchant_id)

+ 19 - 0
db/lj_item.md

@@ -0,0 +1,19 @@
+### lj_item table structure
+> 此表为课程产品的数据结构, 可出售
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| cid | varchar(512) | no | | 课程编码 | |
+| merchant_id | bigint | no | | 渠道id | |
+| is_unit | smallint | no | 0 | 是否分单元 | |
+| cost_price | double(16,2) | no | 0 | 成本价 | |
+| sale_price | double(16,2) | no | 0 | 渠道价格 | |
+| market_price | double(16,2) | no | 0 | 终端价格 | |
+| status | smallint | no | | 状态 | |
+| create_time | smallint | no | now | 创建时间 | |
+| update_time | timestamp | no | now | 更新时间 | | |
+
+##### index
+> unique index (cid, merchant_id)

+ 16 - 0
db/lj_item_price.md

@@ -0,0 +1,16 @@
+### lj_item_price table structure
+> 此表为课程产品的出售价格
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| item_id | bigint | no | | 商品编码 | |
+| type | int | no | | 类型 | |
+| price | double(16,2) | no | 0 | 价格 | |
+| status | smallint | no | | 状态 | |
+| create_time | smallint | no | now | 创建时间 | |
+| update_time | timestamp | no | now | 更新时间 | | |
+
+##### index
+> index item_id

+ 1 - 2
db/lj_lesson_ware_relation.md

@@ -8,8 +8,7 @@
 | lid | varchar(512) | no | | 课编码 | |
 | wid | varchar(512) | no | | 课件编码 | |
 | merchant_id | bigint | no | | 渠道id | |
-| status | smallint | no | | 状态 | |
-| create_time | smallint | no | now | 创建时间 | | |
+| create_time | timestamp | no | now | 创建时间 | | |
 
 ##### index
 > unique index on(lid, wid, merchant_id)

+ 16 - 0
db/lj_price.md

@@ -0,0 +1,16 @@
+### lj_price table structure
+> 此表为出售价格的类型
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | bigint | no | | 主键 | pri |
+| type | smallint | no | | 类型 | |
+| name | varchar(256) | no | | 名字 | |
+| duration | int | no | | 有效期, 单位: day | |
+| status | smallint | no | | 状态 | |
+| create_time | timestamp | no | now | 创建时间 | |
+| update_time | timestamp | no | now | 更新时间 | | |
+
+##### index
+> unique index (type, duration)

+ 0 - 1
db/lj_unit_lesson_relation.md

@@ -8,7 +8,6 @@
 | uid | varchar(512) | no | | 单元编码 | |
 | lid | varchar(512) | no | | 课程编码 | |
 | merchant_id | bigint | no | | 渠道id | |
-| status | smallint | no | | 状态 | |
 | create_time | smallint | no | now | 创建时间 | | |
 
 ##### index

+ 1 - 1
db/lj_ware.md

@@ -10,7 +10,7 @@
 | digest | text | yes | null | 课件摘要 | |
 | type | smallint | no | | 类型 | |
 | status | smallint | no | | 状态 | |
-| create_time | smallint | no | now | 创建时间 | |
+| create_time | timestamp | no | now | 创建时间 | |
 | update_time | timestamp | no | now | 更新时间 | | |
 
 ##### index