fix: add phone search in customers list
This commit is contained in:
parent
7dc1531935
commit
f6327a9e09
|
|
@ -27,6 +27,9 @@ export class QueryCustomerListDTO {
|
|||
|
||||
@ApiProperty()
|
||||
customerId: number;
|
||||
|
||||
@ApiProperty()
|
||||
phone: string;
|
||||
}
|
||||
|
||||
export class CustomerTagDTO {
|
||||
|
|
|
|||
|
|
@ -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}%'`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue