123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /* indent size: 2 */
- // eslint-disable-next-line strict
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const Model = app.model.define('UsersMoneyLogs', {
- log_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true,
- },
- log_desc: {
- type: DataTypes.STRING(255),
- allowNull: true,
- },
- money: {
- type: DataTypes.FLOAT,
- allowNull: true,
- },
- user_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true,
- },
- type: {
- type: DataTypes.INTEGER(2).UNSIGNED,
- allowNull: true,
- },
- inviter_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true,
- },
- inviter_name: {
- type: DataTypes.STRING(255),
- allowNull: true,
- },
- inviter_img: {
- type: DataTypes.STRING(255),
- allowNull: true,
- },
- admin_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true,
- },
- change_time: {
- type: DataTypes.TIME,
- allowNull: true,
- },
- }, {
- tableName: 'szj_users_money_logs',
- });
- Model.associate = function() {
- Model.belongsTo(app.model.AdminUser, { foreignKey: 'admin_id', targetKey: 'admin_id', as: 'admin_user' });
- };
- // 同步:没有就新建,有就不变
- Model.sync();
- return Model;
- };
|