115 lines
2.4 KiB
JavaScript
115 lines
2.4 KiB
JavaScript
'use strict';
|
|
|
|
module.exports = app => {
|
|
const { BIGINT, STRING, DATE, ENUM, INTEGER, TINYINT } = app.Sequelize;
|
|
|
|
const OrderExpress = app.model.define('order_express', {
|
|
id: {
|
|
type: BIGINT(20).UNSIGNED,
|
|
primaryKey: true,
|
|
autoIncrement: true,
|
|
allowNull: false,
|
|
comment: '主键ID',
|
|
},
|
|
waybill_code: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '运单号',
|
|
},
|
|
order_id: {
|
|
type: BIGINT(20),
|
|
allowNull: true,
|
|
comment: '订单ID',
|
|
},
|
|
create_at: {
|
|
type: DATE,
|
|
allowNull: true,
|
|
comment: '创建时间',
|
|
},
|
|
delete_at: {
|
|
type: DATE,
|
|
allowNull: true,
|
|
comment: '删除时间',
|
|
},
|
|
is_galaxy_receive: {
|
|
type: ENUM('Y', 'N'),
|
|
allowNull: true,
|
|
comment: '是否星河签收',
|
|
},
|
|
is_back: {
|
|
type: ENUM('Y', 'N'),
|
|
allowNull: true,
|
|
comment: '是否退回',
|
|
},
|
|
is_intercept: {
|
|
type: ENUM('Y', 'N'),
|
|
allowNull: true,
|
|
comment: '是否拦截',
|
|
},
|
|
logistics_code: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '物流编码',
|
|
},
|
|
logistics_interface_id: {
|
|
type: BIGINT(20).UNSIGNED,
|
|
allowNull: true,
|
|
comment: '物流接口ID',
|
|
},
|
|
logistics_name: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '物流名称',
|
|
},
|
|
logistics_interface_name: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '物流接口名称',
|
|
},
|
|
platform_code: {
|
|
type: STRING(50),
|
|
allowNull: true,
|
|
comment: '平台编码',
|
|
},
|
|
business_key: {
|
|
type: INTEGER(3),
|
|
allowNull: true,
|
|
comment: '业务键',
|
|
},
|
|
status: {
|
|
type: TINYINT(1),
|
|
allowNull: true,
|
|
defaultValue: 0,
|
|
comment: '状态',
|
|
},
|
|
retry_count: {
|
|
type: TINYINT(3),
|
|
allowNull: true,
|
|
comment: '重试次数',
|
|
},
|
|
}, {
|
|
tableName: 'wms_order_express',
|
|
freezeTableName: true,
|
|
underscored: true,
|
|
timestamps: false,
|
|
comment: '订单快递信息表',
|
|
indexes: [
|
|
{
|
|
name: 'uk_order_id_business_key',
|
|
unique: true,
|
|
fields: [ 'order_id', 'business_key' ],
|
|
},
|
|
{
|
|
name: 'idx_waybill_code',
|
|
fields: [ 'waybill_code' ],
|
|
},
|
|
{
|
|
name: 'idx_create_at',
|
|
fields: [ 'create_at' ],
|
|
},
|
|
],
|
|
});
|
|
|
|
return OrderExpress;
|
|
};
|