feat: search also cover code
This commit is contained in:
parent
9e38fac8a7
commit
0ae9ea4ddf
2 changed files with 14 additions and 2 deletions
|
|
@ -134,7 +134,13 @@ export class ProductController extends Controller {
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
OR: query ? [{ name: { contains: query } }, { detail: { contains: query } }] : undefined,
|
OR: query
|
||||||
|
? [
|
||||||
|
{ name: { contains: query } },
|
||||||
|
{ detail: { contains: query } },
|
||||||
|
{ code: { contains: query } },
|
||||||
|
]
|
||||||
|
: undefined,
|
||||||
AND: {
|
AND: {
|
||||||
...filterStatus(status),
|
...filterStatus(status),
|
||||||
productGroupId,
|
productGroupId,
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,13 @@ export class ServiceController extends Controller {
|
||||||
@Query() fullDetail?: boolean,
|
@Query() fullDetail?: boolean,
|
||||||
) {
|
) {
|
||||||
const where = {
|
const where = {
|
||||||
OR: query ? [{ name: { contains: query } }, { detail: { contains: query } }] : undefined,
|
OR: query
|
||||||
|
? [
|
||||||
|
{ name: { contains: query } },
|
||||||
|
{ detail: { contains: query } },
|
||||||
|
{ code: { contains: query } },
|
||||||
|
]
|
||||||
|
: undefined,
|
||||||
AND: {
|
AND: {
|
||||||
...filterStatus(status),
|
...filterStatus(status),
|
||||||
productGroupId,
|
productGroupId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue