extend calendar link
This commit is contained in:
parent
020ae4a939
commit
e9b29f8acf
2 changed files with 14 additions and 4 deletions
|
@ -44,12 +44,18 @@ export default abstract class CalendarService {
|
|||
* @description get calendar by types
|
||||
* @returns {Promise<Array<calendar>>}
|
||||
*/
|
||||
static async getByTypes(types: Array<number>): Promise<Array<calendar>> {
|
||||
return await dataSource
|
||||
static async getByTypes(types: Array<number>, addNscdr: boolean = false): Promise<Array<calendar>> {
|
||||
const query = dataSource
|
||||
.getRepository(calendar)
|
||||
.createQueryBuilder("calendar")
|
||||
.leftJoinAndSelect("calendar.type", "type")
|
||||
.where("type.id IN (:...types)", { types: types })
|
||||
.where("type.id IN (:...types)", { types: types });
|
||||
|
||||
if (addNscdr) {
|
||||
query.orWhere("type.nscdr = :nscdr", { nscdr: true });
|
||||
}
|
||||
|
||||
return await query
|
||||
.getMany()
|
||||
.then((res) => {
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue