seasons.ts 1.4 KB
module.exports = function(sequelize:any, DataTypes:any) {
  return sequelize.define('seasons', {
    id: {
      autoIncrement: true,
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true,
      comment: "赛季ID"
    },
    competition_id: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "赛事ID"
    },
    end_time: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "结束时间"
    },
    has_player_stats: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "是否有球员统计,1-是、0-否"
    },
    has_table: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "是否有积分榜,1-是、0-否"
    },
    has_team_stats: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "是否有球队统计,1-是、0-否"
    },
    is_current: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "是否最新赛季,1-是、0-否"
    },
    start_time: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "开始时间"
    },
    year: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "赛季年份"
    },
    updated_at: {
      type: DataTypes.BIGINT,
      allowNull: true,
      get(){
        return moment(this.getDataValue('updated_at')).format('YYYY-MM-DD HH:mm:ss');
      }
    },
  });
};