.inscripciones online
This commit is contained in:
parent
dbfa733f5d
commit
c22a469ae5
@ -61,9 +61,10 @@ const extraMethods = {
|
||||
},
|
||||
|
||||
_getInscriptionOnlineByEvent: (eventId) => {
|
||||
return models.EventInscription.scope("defaultScope").findAll({
|
||||
return models.EventInscriptionOnline.scope("defaultScope").findAll({
|
||||
where: {
|
||||
eventId: eventId,
|
||||
//type: ["online", "online group"],
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
@ -39,33 +39,46 @@ module.exports = function (sequelize, DataTypes) {
|
||||
email: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
// defaultValue: "regular", //grupal, invitacion-regular, invitation-grupal, online, online group, onsite, onsite group
|
||||
},
|
||||
name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
surname: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
entity_name: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
assistants: {
|
||||
type: DataTypes.INTEGER,
|
||||
},
|
||||
profile: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
tableName: "v_events_inscriptions_online",
|
||||
freezeTableName: true,
|
||||
timestamps: true,
|
||||
timestamps: false,
|
||||
|
||||
defaultScope: {
|
||||
order: [["date", "DESC"]],
|
||||
include: [
|
||||
{
|
||||
model: sequelize.models.User,
|
||||
as: "user",
|
||||
include: [{ model: sequelize.models.Entity, attributes: ["id", "name"], required: false }],
|
||||
},
|
||||
],
|
||||
// include: [
|
||||
// {
|
||||
// model: sequelize.models.User,
|
||||
// as: "user",
|
||||
// include: [{ model: sequelize.models.Entity, attributes: ["id", "name"], required: false }],
|
||||
// },
|
||||
// ],
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
EventInscriptionOnline.associate = function (models) {
|
||||
EventInscriptionOnline.Event = EventInscriptionOnline.belongsTo(models.Event, { foreignKey: "eventId", as: "event" });
|
||||
EventInscriptionOnline.User = EventInscriptionOnline.belongsTo(models.User, { foreignKey: "userId", as: "user" });
|
||||
// EventInscriptionOnline.User = EventInscriptionOnline.belongsTo(models.User, { foreignKey: "userId", as: "user" });
|
||||
};
|
||||
|
||||
return EventInscriptionOnline;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user