From f6327a9e094e6a4d149ec5a6acbedcf9c621f9c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E7=8F=91?= Date: Tue, 6 Jan 2026 17:34:54 +0800 Subject: [PATCH] fix: add phone search in customers list --- src/dto/customer.dto.ts | 3 +++ src/service/customer.service.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/dto/customer.dto.ts b/src/dto/customer.dto.ts index 9fa62cd..bbdc4b0 100644 --- a/src/dto/customer.dto.ts +++ b/src/dto/customer.dto.ts @@ -27,6 +27,9 @@ export class QueryCustomerListDTO { @ApiProperty() customerId: number; + + @ApiProperty() + phone: string; } export class CustomerTagDTO { diff --git a/src/service/customer.service.ts b/src/service/customer.service.ts index b039ecb..209b58d 100644 --- a/src/service/customer.service.ts +++ b/src/service/customer.service.ts @@ -28,11 +28,17 @@ export class CustomerService { first_purchase_date, customerId, rate, + phone, } = param; const whereConds: string[] = []; const havingConds: string[] = []; + // phone过滤 + if (phone) { + whereConds.push(`o.billing LIKE '%${phone}%'`) + } + // 邮箱搜索 if (email) { whereConds.push(`o.customer_email LIKE '%${email}%'`);