1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| import { BaseEntity } from '@cool-midway/core';
| import { Column, Entity, Index } from 'typeorm';
| import { GoodsInfoEntity } from '../../goods/entity/info';
| import { GoodsSpecEntity } from '../../goods/entity/spec';
|
| /**
| * 订单商品
| */
| @Entity('order_goods')
| export class OrderGoodsEntity extends BaseEntity {
| @Index()
| @Column({ comment: '订单ID' })
| orderId: number;
|
| @Index()
| @Column({ comment: '商品ID' })
| goodsId: number;
|
| @Column({
| comment: '价格',
| type: 'decimal',
| precision: 12,
| scale: 2,
| })
| price: number;
|
| @Column({
| comment: '优惠金额',
| type: 'decimal',
| scale: 2,
| precision: 12,
| default: 0,
| })
| discountPrice: number;
|
| @Column({ comment: '数量' })
| count: number;
|
| @Column({ comment: '其他信息', nullable: true })
| remark: string;
|
| // 随着时间的推移,商品信息会变,这边必须记录购买时的商品信息
| @Column({ comment: '商品信息', type: 'json' })
| goodsInfo: GoodsInfoEntity;
|
| @Column({ comment: '规格', type: 'json', nullable: true })
| spec: GoodsSpecEntity;
|
| @Column({ comment: '是否评价 0-否 1-是', default: 0 })
| isComment: number;
| }
|
|