123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- /* indent size: 2 */
- // eslint-disable-next-line strict
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const Model = app.model.define('UsersCashLogs', {
- log_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true,
- },
- out_batch_no: {
- type: DataTypes.STRING(128),
- allowNull: true,
- },
- out_detail_no: {
- type: DataTypes.STRING(128),
- allowNull: true,
- },
- batch_id: {
- type: DataTypes.STRING(64),
- allowNull: true,
- },
- detail_id: {
- type: DataTypes.STRING(64),
- allowNull: true,
- },
- detail_status: {
- type: DataTypes.STRING(64),
- allowNull: true,
- },
- fail_reason: {
- type: DataTypes.STRING(64),
- allowNull: true,
- },
- batch_name: {
- type: DataTypes.STRING(32),
- allowNull: true,
- },
- batch_remark: {
- type: DataTypes.STRING(32),
- allowNull: true,
- },
- cash: {
- type: DataTypes.FLOAT,
- allowNull: true,
- },
- user_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true,
- },
- type: {
- type: DataTypes.INTEGER(2).UNSIGNED,
- allowNull: true,
- },
- create_time: {
- type: DataTypes.TIME,
- allowNull: true,
- },
- update_time: {
- type: DataTypes.TIME,
- allowNull: true,
- },
- partner_id: {
- type: DataTypes.INTEGER(11),
- allowNull: true,
- },
- }, {
- tableName: 'szj_users_cash_logs',
- });
- Model.associate = function() {
- // 关联用户表
- Model.belongsTo(app.model.Users, { foreignKey: 'user_id', targetKey: 'user_id', as: 'user' });
- };
- // 同步:没有就新建,有就不变
- Model.sync();
- return Model;
- };
|