'use strict'; /** * 快递公司字典模型,对应 express_companies 表(通用字典,不区分主体) * * 供发货单等单据选择物流公司:code 使用行业/WMS 标准编码(SF/YTO/ZTO...), * 选择后写入单据的 logistics_code / logistics_name。 * @param {Egg.Application} app egg application * @return {object} expressCompany model */ module.exports = app => { const { BIGINT, STRING, TINYINT, INTEGER, DATE } = app.Sequelize; const ExpressCompany = app.model.define('express_company', { id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, code: { type: STRING(50), allowNull: false, comment: '快递公司编码(行业/WMS 标准编码,如 SF/YTO/ZTO)' }, name: { type: STRING(100), allowNull: false, comment: '快递公司名称(如 顺丰速运)' }, status: { type: TINYINT, allowNull: false, defaultValue: 1, comment: '状态:1启用 0禁用' }, sort: { type: INTEGER, allowNull: false, defaultValue: 0, comment: '排序(下拉展示顺序,越小越靠前)' }, remark: { type: STRING(255), comment: '备注' }, created_at: { type: DATE, comment: '创建时间' }, updated_at: { type: DATE, comment: '更新时间' }, }, { tableName: 'express_companies', comment: '快递公司字典', }); return ExpressCompany; };