})
}
-function listRandomPodIdsWithRequest (limit, tableRequestPod, callback) {
+function listRandomPodIdsWithRequest (limit, tableWithPods, tableWithPodsJoins, callback) {
+ if (!callback) {
+ callback = tableWithPodsJoins
+ tableWithPodsJoins = ''
+ }
+
const self = this
self.count().asCallback(function (err, count) {
where: {
id: {
$in: [
- this.sequelize.literal('SELECT "podId" FROM "' + tableRequestPod + '"')
+ this.sequelize.literal(`SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins}`)
]
}
}