fixing
This commit is contained in:
@ -4,7 +4,7 @@ import { OrmHelper } from "../helpers/orm";
|
||||
import { FactoryToSupplier } from "entity";
|
||||
|
||||
export class FactoryToSupplierModel {
|
||||
static async listFactorybySupplier(supplier_id: string, filter = {}): Promise<SelectQueryBuilder<any>> {
|
||||
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
|
||||
const repo = OrmHelper.DB.getRepository(FactoryToSupplier);
|
||||
let whereAttr: string[] = [];
|
||||
let whereVal: any = {};
|
||||
@ -16,7 +16,6 @@ export class FactoryToSupplierModel {
|
||||
var query = repo.createQueryBuilder("factory_to_supplier")
|
||||
.leftJoinAndSelect("factory_to_supplier.factory", "factory")
|
||||
.leftJoinAndSelect("factory_to_supplier.supplier", "supplier")
|
||||
.where("factory_to_supplier.supplier_id = :supplierId", { supplierId: supplier_id });
|
||||
if (whereAttr.length != 0) {
|
||||
query = query.where(whereAttr.join(" and "), whereVal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user