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}%'`);