forked from yoone/WEB
1
0
Fork 0

fix: add phone search in customers list

This commit is contained in:
黄珑 2026-01-06 17:34:54 +08:00 committed by longbot
parent 7dc1531935
commit f6327a9e09
2 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,9 @@ export class QueryCustomerListDTO {
@ApiProperty() @ApiProperty()
customerId: number; customerId: number;
@ApiProperty()
phone: string;
} }
export class CustomerTagDTO { export class CustomerTagDTO {

View File

@ -28,11 +28,17 @@ export class CustomerService {
first_purchase_date, first_purchase_date,
customerId, customerId,
rate, rate,
phone,
} = param; } = param;
const whereConds: string[] = []; const whereConds: string[] = [];
const havingConds: string[] = []; const havingConds: string[] = [];
// phone过滤
if (phone) {
whereConds.push(`o.billing LIKE '%${phone}%'`)
}
// 邮箱搜索 // 邮箱搜索
if (email) { if (email) {
whereConds.push(`o.customer_email LIKE '%${email}%'`); whereConds.push(`o.customer_email LIKE '%${email}%'`);