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.
vue-shop-admin-work/models/OrderModel.js

41 lines
1.7 KiB

This file contains ambiguous Unicode characters!

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();
}