feat: search quotation now cover customer name and code
This commit is contained in:
parent
8da915b868
commit
447a99e4f7
1 changed files with 16 additions and 1 deletions
|
|
@ -183,7 +183,22 @@ export class QuotationController extends Controller {
|
|||
@Query() query = "",
|
||||
) {
|
||||
const where = {
|
||||
OR: [{ code: { contains: query, mode: "insensitive" } }, { workName: { contains: query } }],
|
||||
OR: [
|
||||
{ code: { contains: query, mode: "insensitive" } },
|
||||
{ workName: { contains: query } },
|
||||
{
|
||||
customerBranch: {
|
||||
OR: [
|
||||
{ code: { contains: query, mode: "insensitive" } },
|
||||
{ customerName: { contains: query } },
|
||||
{ firstName: { contains: query } },
|
||||
{ firstNameEN: { contains: query } },
|
||||
{ lastName: { contains: query } },
|
||||
{ lastNameEN: { contains: query } },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
payCondition,
|
||||
registeredBranch: isSystem(req.user) ? undefined : { OR: permissionCond(req.user) },
|
||||
} satisfies Prisma.QuotationWhereInput;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue