.
This commit is contained in:
parent
d241db12e8
commit
95413ca00e
@ -57,6 +57,15 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
timestamps: true,
|
timestamps: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
NotificationDetail.addScope('onlyWithoutReceipt', () => {
|
||||||
|
return {
|
||||||
|
where: {
|
||||||
|
receiptDate: { [Sequelize.Op.ne]: null }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
NotificationDetail.associate = function (models) {
|
NotificationDetail.associate = function (models) {
|
||||||
NotificationDetail.User = NotificationDetail.belongsTo(models.User, { foreignKey: 'userId', as: "user" });
|
NotificationDetail.User = NotificationDetail.belongsTo(models.User, { foreignKey: 'userId', as: "user" });
|
||||||
//NotificationDetail.Notification = NotificationDetail.belongsTo(models.Notification, { foreignKey: 'notificationId', as: "user" });
|
//NotificationDetail.Notification = NotificationDetail.belongsTo(models.Notification, { foreignKey: 'notificationId', as: "user" });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user