You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
// 导出一个函数, 这个函数接受数据库对象db和一个回调函数callback作为参数
module . exports = function ( db , callback ) {
// 用户模型
// 使用db.define方法定义一个模型, 模型名为OrderModel
db . define ( "OrderModel" , {
// 定义模型的属性
order _id : { type : 'serial' , key : true } , // 订单ID, 自增主键
user _id : Number ,
// 用户ID, 类型为数字
order _number : String ,
// 订单编号,类型为字符串
order _price : Number ,
// 订单总价,类型为数字
order _pay : [ 1 , 2 , 3 ] ,
// 订单支付方式,类型为数字数组,具体值可能代表不同的支付方式
is _send : [ "是" , "否" ] ,
// 是否发货,类型为字符串数组,可能代表“是”和“否”
trade _no : String ,
// 交易编号,类型为字符串
order _fapiao _title : [ "个人" , "公司" ] ,
// 发票抬头,类型为字符串数组,可能代表“个人”和“公司”
order _fapiao _company : String ,
// 发票公司名称,类型为字符串
order _fapiao _content : String ,
// 发票内容,类型为字符串
consignee _addr : String ,
// 收货人地址,类型为字符串
pay _status : [ '0' , '1' ] ,
// 支付状态,类型为字符串数组,可能代表不同的支付状态
create _time : Number ,
// 创建时间,类型为数字(可能是时间戳)
update _time : Number
// 更新时间,类型为数字(可能是时间戳)
} , {
// 定义模型的选项
table : "sp_order"
// 指定模型对应的数据库表名为sp_order
} ) ;
// 调用回调函数,传入无参数
return callback ( ) ;
}