# `plat_order`

> 平台订单表


- **Engine:** InnoDB
- **Collation:** utf8mb3_general_ci

## Columns

| # | Name | Type | Null | Key | Default | Extra | Comment |
|---|---|---|---|---|---|---|---|
| 1 | `iIncreaseId` | `int` | NO | PRI |  | auto_increment | 主键(自增序列) |
| 2 | `tCreateTime` | `datetime` | NO | MUL |  |  | 创建时间 |
| 3 | `tModifyTime` | `datetime` | NO |  |  |  | 修改时间 |
| 4 | `sShopUserId` | `varchar(35)` | NO | MUL |  |  | 店铺用户编号 |
| 5 | `sCustomerUserId` | `varchar(35)` | NO | MUL |  |  | 客户用户编号 |
| 6 | `sMakerUserId` | `varchar(35)` | NO |  |  |  | 制单人用户编号 |
| 7 | `sOrderId` | `varchar(35)` | NO | UNI |  |  | 订单编号(P_ODR开头) |
| 8 | `sSerialNumber` | `varchar(13)` | NO | MUL |  |  | 订单流水号 |
| 9 | `sProductNames` | `varchar(50)` | NO | MUL |  |  | 产品名称串(逗号分割) |
| 10 | `tSendTime` | `datetime` | YES |  |  |  | 送货时间(前台填写) |
| 11 | `tPayTime` | `datetime` | YES | MUL |  |  | 付款时间 |
| 12 | `tSettlementTime` | `datetime` | YES |  |  |  | 结算时间 |
| 13 | `tExpectSendTime` | `datetime` | YES |  |  |  | 预计送货时间(后台填写) |
| 14 | `sLevel2ClassifyIds` | `varchar(255)` | NO | MUL |  |  | 2级分类编号串(逗号分割) |
| 15 | `sLevel3ClassifyIds` | `varchar(255)` | NO | MUL |  |  | 3级分类编号串(逗号分割) |
| 16 | `iTradeType` | `tinyint` | NO |  | 0 |  | 交易类型(0:报价,1:定制产品) |
| 17 | `sBusinessPersonUserId` | `varchar(35)` | NO |  |  |  | 业务人员编号 |
| 18 | `iStatus` | `tinyint` | NO | MUL | 0 |  | 订单状态(-1:已关闭,0:待付款,1:待生产,2:待上报,3:待发货,4:待收货,5:已收货) |
| 19 | `iRefundStatus` | `tinyint` | NO |  | 0 |  | 退款状态(0:未申请,1:退款中,2:全部退款,3:部分退款,4:退款驳回) |
| 20 | `iPayStatus` | `tinyint` | NO |  | 0 |  | 付款状态(0:未付款,1:已付款) |
| 21 | `iIsFileUpload` | `tinyint` | NO |  | 0 |  | 是否上传文件(0:未上传,1:已上传) |
| 22 | `iOrderSource` | `tinyint(4) unsigned zerofill` | NO |  |  |  | 订单来源(0:平台,1:印果,2:微信) |
| 23 | `iSettlementMethod` | `tinyint` | NO |  | 0 |  | 结算方式(0:按月份,1:按天数,2:先付后做,3:货到付款,4:线下收款) |
| 24 | `iPaymentMethodId` | `tinyint` | NO |  |  |  | 支付方式编号 |
| 25 | `dPreDiscountMoney` | `decimal(18,2)` | NO |  | 0.00 |  | 折前价 |
| 26 | `dPostDiscountMoney` | `decimal(18,2)` | NO |  | 0.00 |  | 折后价 |
| 27 | `dFavourableMoney` | `decimal(18,2)` | NO |  | 0.00 |  | 优惠金额 |
| 28 | `dPresentMoney` | `decimal(18,2)` | NO |  | 0.00 |  | 现价 |
| 29 | `dLogisticsMoney` | `decimal(18,2)` | NO |  | 0.00 |  | 物流费用 |
| 30 | `iUseIntegral` | `int` | NO |  | 0 |  | 使用积分数 |
| 31 | `dIntegralConversionMoney` | `decimal(18,2)` | NO |  | 0.00 |  | 积分换算金额 |
| 32 | `iIsAllowClose` | `tinyint` | NO |  | 1 |  | 是否允许取消订单(0:不允许,1:允许) |
| 33 | `sCustomerRemark` | `varchar(255)` | NO |  |  |  | 客户备注 |
| 34 | `sShopRemark` | `varchar(255)` | NO |  |  |  | 商铺备注 |
| 35 | `iIsErpObtain` | `tinyint` | NO |  | 0 |  | 是否erp获取(0:未获取,1:已获取) |
| 36 | `iIsLock` | `tinyint` | NO |  | 0 |  | 是否锁定(0:未锁定,1:锁定) |

## Indexes

| Name | Unique | Type | Columns |
|---|---|---|---|
| `PLAT_ORDER_IDX1` |  | BTREE | `sShopUserId` |
| `PLAT_ORDER_IDX2` |  | BTREE | `tCreateTime` |
| `PLAT_ORDER_IDX3` |  | BTREE | `sCustomerUserId` |
| `PLAT_ORDER_IDX4` |  | BTREE | `tPayTime` |
| `PLAT_ORDER_IDX5` |  | BTREE | `sProductNames` |
| `PLAT_ORDER_IDX6` |  | BTREE | `sLevel2ClassifyIds` |
| `PLAT_ORDER_IDX7` |  | BTREE | `sLevel3ClassifyIds` |
| `PLAT_ORDER_IDX8` |  | BTREE | `iStatus` |
| `PLAT_ORDER_UNQ1` | ✓ | BTREE | `sOrderId` |
| `PLAT_ORDER_UNQ2` | ✓ | BTREE | `sSerialNumber`, `sShopUserId` |
| `PRIMARY` | ✓ | BTREE | `iIncreaseId` |

## Narrative

_No human-written narrative yet — when this table is exercised by a [vertical slice](../../slices/index.md), link from there back to this page._
