This commit is contained in:
2026-04-17 13:28:22 +07:00
parent a9878c691f
commit cc25ae1fe9
6 changed files with 1309 additions and 988 deletions

27
src/model/currencies.ts Normal file
View File

@ -0,0 +1,27 @@
import { Currency } from "entity";
import { SelectQueryBuilder } from "typeorm";
import CommonHelper from "../helpers/common";
import { OrmHelper } from "../helpers/orm";
export class CurrencyModel {
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
const repo = OrmHelper.DB.getRepository(Currency);
let whereAttr = [];
let whereVal: any = {};
if (filter) {
whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr];
whereVal = {
...whereVal,
...CommonHelper.handleQueryFilter(filter).whereVal,
};
}
var query = null;
query = repo.createQueryBuilder();
if (whereAttr.length != 0) {
query = query.where(whereAttr.join(" and "), whereVal);
}
return query;
}
}