Commit 11f53e76 authored by 李尚科's avatar 李尚科
parents 1eb52603 b2c33c01
Pipeline #13437 passed with stage
in 38 seconds
'use strict';
const moment = require('moment');
module.exports = app => {
const { INTEGER, STRING, DATE, TEXT, DECIMAL } = app.Sequelize;
const CreditOrder = app.prometheusModel.define('credit_order', {
id: {
type: INTEGER,
primaryKey: true,
autoIncrement: true
},
apply_id: INTEGER,
report_id: INTEGER,
type: INTEGER,
user_id: STRING,
app_user_id: STRING,
app_id: STRING,
app_type_id: STRING,
price: DECIMAL,
preferential_id: INTEGER,
preferential_price: DECIMAL,
final_price: DECIMAL,
state: STRING,
state_time: {
type: DATE,
get() {
const date = this.getDataValue('state_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
pay_status: STRING,
pay_method: STRING,
valid: INTEGER,
created_at: {
type: DATE,
get() {
const date = this.getDataValue('created_at');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
updated_at: {
type: DATE,
get() {
const date = this.getDataValue('updated_at');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
deleted_at: {
type: DATE,
get() {
const date = this.getDataValue('deleted_at');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
}
}, {
timestamps: false,
tableName: 'credit_order',
});
return CreditOrder;
};
'use strict';
const moment = require('moment');
module.exports = app => {
const { INTEGER, STRING, DATE, DECIMAL } = app.Sequelize;
const CreditOrderPreferential = app.prometheusModel.define('credit_order_preferential', {
id: {
type: INTEGER,
primaryKey: true,
autoIncrement: true
},
type: INTEGER,
alias: STRING,
name: STRING,
price: DECIMAL,
description: STRING,
start_time: {
type: DATE,
get() {
const date = this.getDataValue('start_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
end_time: {
type: DATE,
get() {
const date = this.getDataValue('end_time');
return date ? moment(date).format('YYYY-MM-DD HH:mm:ss') : undefined;
},
},
valid: INTEGER
}, {
timestamps: false,
tableName: 'credit_order_preferential',
});
return CreditOrderPreferential;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment