fix search ออกคำสั่ง
This commit is contained in:
parent
3871ec5f9f
commit
cb4fc6defb
1 changed files with 12 additions and 12 deletions
|
|
@ -88,18 +88,6 @@ export class CommandController extends Controller {
|
|||
) {
|
||||
const [commands, total] = await this.commandRepository
|
||||
.createQueryBuilder("command")
|
||||
.andWhere(
|
||||
new Brackets((qb) => {
|
||||
qb.where(keyword != null && keyword != "" ? "command.commandNo LIKE :keyword" : "1=1", {
|
||||
keyword: `%${keyword}%`,
|
||||
}).orWhere(
|
||||
keyword != null && keyword != "" ? "command.createdFullName LIKE :keyword" : "1=1",
|
||||
{
|
||||
keyword: `%${keyword}%`,
|
||||
},
|
||||
);
|
||||
}),
|
||||
)
|
||||
.andWhere(
|
||||
status != null && status != undefined && status != ""
|
||||
? "command.status IN (:...status)"
|
||||
|
|
@ -133,6 +121,18 @@ export class CommandController extends Controller {
|
|||
: `${commandTypeId}`,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
new Brackets((qb) => {
|
||||
qb.where(keyword != null && keyword != "" ? "command.commandNo LIKE :keyword" : "1=1", {
|
||||
keyword: `%${keyword}%`,
|
||||
}).orWhere(
|
||||
keyword != null && keyword != "" ? "command.issue LIKE :keyword" : "1=1",
|
||||
{
|
||||
keyword: `%${keyword}%`,
|
||||
},
|
||||
);
|
||||
}),
|
||||
)
|
||||
.orderBy("command.createdAt", "DESC")
|
||||
.skip((page - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue