remove duplicate links because of join with link_labels table

This commit is contained in:
Hongbo Wu 2022-02-23 17:12:37 +08:00
parent fc18004a5d
commit c7841b8e8a

View file

@ -448,10 +448,9 @@ class UserArticleModel extends DataModel<
.innerJoin(Table.LINK_LABELS, 'link_labels.link_id', 'links.id')
.innerJoin(Table.LABELS, 'labels.id', 'link_labels.label_id')
.whereRaw('LOWER(omnivore.labels.name) = ANY(?)', [args.labelFilters])
.distinct('links.id')
}
console.log(queryPromise.toString())
if (notNullField) {
queryPromise.whereNotNull(notNullField)
}