เพิ่มตวแปรnullค้นหา dashboard

This commit is contained in:
Kittapath 2024-03-27 17:08:28 +07:00
parent fc90b1ff4a
commit 4ff04f0dc5
2 changed files with 106 additions and 3 deletions

View file

@ -13,7 +13,7 @@ import {
Query,
} from "tsoa";
import { AppDataSource } from "../database/data-source";
import { In, Not, MoreThan, Brackets } from "typeorm";
import { In, Not, MoreThan, Brackets, Like } from "typeorm";
import HttpSuccess from "../interfaces/http-success";
import HttpError from "../interfaces/http-error";
import HttpStatusCode from "../interfaces/http-status";
@ -124,7 +124,7 @@ export class SalaryPeriodEmployeeController extends Controller {
const _salaryOrg = await this.salaryOrgRepository.find({
relations: ["salaryPeriod", "salaryProfiles"],
where: {
group: body.group,
group: Like(`%${body.group}%`),
snapshot: body.snapshot.trim().toUpperCase(),
salaryPeriod: { period: body.period.trim().toUpperCase(), year: body.year },
},
@ -143,6 +143,7 @@ export class SalaryPeriodEmployeeController extends Controller {
}, 0);
const data = {
org: org,
group: item.group,
total: item.total,
fifteenPercent: item.fifteenPercent,
chosen: item.quantityUsed,