a
This commit is contained in:
parent
d52df0bc68
commit
05e7d6494d
@ -160,6 +160,9 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
city: {
|
city: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
},
|
},
|
||||||
|
country: {
|
||||||
|
type: DataTypes.STRING,
|
||||||
|
},
|
||||||
url_streaming: {
|
url_streaming: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
},
|
},
|
||||||
@ -354,8 +357,8 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
|
|
||||||
Event.addScope('CitiesOfEvents', {
|
Event.addScope('CitiesOfEvents', {
|
||||||
include : [{ model: sequelize.models.EventType, as: 'type', attributes:['name', 'title'] }],
|
include : [{ model: sequelize.models.EventType, as: 'type', attributes:['name', 'title'] }],
|
||||||
group: ['city', 'typeId'],
|
group: ['city', 'country', 'typeId'],
|
||||||
attributes: ['city', 'type.name', 'type.title', [sequelize.fn('COUNT', sequelize.col('typeId')), 'ediciones'], [sequelize.fn('SUM', sequelize.col('assistants')), 'assistants']]
|
attributes: ['city', 'country', 'type.name', 'type.title', [sequelize.fn('COUNT', sequelize.col('typeId')), 'ediciones'], [sequelize.fn('SUM', sequelize.col('assistants')), 'assistants']]
|
||||||
});
|
});
|
||||||
|
|
||||||
Event.addScope('onlyOfCity', (city) => {
|
Event.addScope('onlyOfCity', (city) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user