Compare commits
No commits in common. "e5a3d948a5f3acf7037727505eb6b3a5b3aad181" and "ab4ea4ba4b7fce3a354f422dd26b153233cbff04" have entirely different histories.
e5a3d948a5
...
ab4ea4ba4b
1 changed files with 0 additions and 53 deletions
|
|
@ -170,10 +170,6 @@ export class CustomerController extends Controller {
|
||||||
@Query() activeBranchOnly?: boolean,
|
@Query() activeBranchOnly?: boolean,
|
||||||
@Query() startDate?: Date,
|
@Query() startDate?: Date,
|
||||||
@Query() endDate?: Date,
|
@Query() endDate?: Date,
|
||||||
@Query() businessType?: string,
|
|
||||||
@Query() province?: string,
|
|
||||||
@Query() district?: string,
|
|
||||||
@Query() subDistrict?: string,
|
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
OR: queryOrNot<Prisma.CustomerWhereInput[]>(query, [
|
OR: queryOrNot<Prisma.CustomerWhereInput[]>(query, [
|
||||||
|
|
@ -196,47 +192,6 @@ export class CustomerController extends Controller {
|
||||||
: permissionCond(req.user, { activeOnly: activeBranchOnly }),
|
: permissionCond(req.user, { activeOnly: activeBranchOnly }),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
branch: {
|
|
||||||
some: {
|
|
||||||
AND: [
|
|
||||||
businessType
|
|
||||||
? {
|
|
||||||
OR: [
|
|
||||||
{ businessType: { name: { contains: businessType, mode: "insensitive" } } },
|
|
||||||
{ businessType: { nameEN: { contains: businessType, mode: "insensitive" } } },
|
|
||||||
],
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
|
|
||||||
province
|
|
||||||
? {
|
|
||||||
OR: [
|
|
||||||
{ province: { name: { contains: province, mode: "insensitive" } } },
|
|
||||||
{ province: { nameEN: { contains: province, mode: "insensitive" } } },
|
|
||||||
],
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
|
|
||||||
district
|
|
||||||
? {
|
|
||||||
OR: [
|
|
||||||
{ district: { name: { contains: district, mode: "insensitive" } } },
|
|
||||||
{ district: { nameEN: { contains: district, mode: "insensitive" } } },
|
|
||||||
],
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
|
|
||||||
subDistrict
|
|
||||||
? {
|
|
||||||
OR: [
|
|
||||||
{ subDistrict: { name: { contains: subDistrict, mode: "insensitive" } } },
|
|
||||||
{ subDistrict: { nameEN: { contains: subDistrict, mode: "insensitive" } } },
|
|
||||||
],
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
...whereDateQuery(startDate, endDate),
|
...whereDateQuery(startDate, endDate),
|
||||||
} satisfies Prisma.CustomerWhereInput;
|
} satisfies Prisma.CustomerWhereInput;
|
||||||
|
|
||||||
|
|
@ -642,10 +597,6 @@ export class CustomerExportController extends CustomerController {
|
||||||
@Query() activeBranchOnly?: boolean,
|
@Query() activeBranchOnly?: boolean,
|
||||||
@Query() startDate?: Date,
|
@Query() startDate?: Date,
|
||||||
@Query() endDate?: Date,
|
@Query() endDate?: Date,
|
||||||
@Query() businessType?: string,
|
|
||||||
@Query() province?: string,
|
|
||||||
@Query() district?: string,
|
|
||||||
@Query() subDistrict?: string,
|
|
||||||
) {
|
) {
|
||||||
const ret = await this.list(
|
const ret = await this.list(
|
||||||
req,
|
req,
|
||||||
|
|
@ -659,10 +610,6 @@ export class CustomerExportController extends CustomerController {
|
||||||
activeBranchOnly,
|
activeBranchOnly,
|
||||||
startDate,
|
startDate,
|
||||||
endDate,
|
endDate,
|
||||||
businessType,
|
|
||||||
province,
|
|
||||||
district,
|
|
||||||
subDistrict,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.setHeader("Content-Type", "text/csv");
|
this.setHeader("Content-Type", "text/csv");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue