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/ReportOneModel.js

22 lines
828 B

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) {
// 报表模型1
// 使用db.define方法定义一个模型模型名为ReportOneModel
db.define("ReportOneModel", {
// 定义模型的属性
id: {type: 'serial', key: true},
// 唯一标识ID自增主键
rp1_user_count: Number,
// 用户数量,类型为数字
rp1_area: Number,
// 区域代码或标识,类型为数字
rp1_date: { type: "date", time: false }
// 报表日期,类型为日期,不包含时间信息
}, {
// 定义模型的选项
table: "sp_report_1"
// 指定模型对应的数据库表名为sp_report_1
});
// 调用回调函数,传入无参数
return callback();
}