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