Improvement: 订单请求接口添加payment_method相关内容
This commit is contained in:
parent
a386a0d2f3
commit
e45d43e96e
|
|
@ -83,6 +83,10 @@ export class QueryOrderDTO {
|
|||
@ApiProperty({ type: 'enum', enum: ErpOrderStatus })
|
||||
@Rule(RuleType.string().valid(...Object.values(ErpOrderStatus)))
|
||||
status: ErpOrderStatus;
|
||||
|
||||
@ApiProperty()
|
||||
@Rule(RuleType.string())
|
||||
payment_method: string;
|
||||
}
|
||||
|
||||
export class QueryOrderSalesDTO {
|
||||
|
|
|
|||
|
|
@ -549,6 +549,7 @@ export class OrderService {
|
|||
current,
|
||||
pageSize,
|
||||
customer_email,
|
||||
payment_method,
|
||||
}, userId = undefined) {
|
||||
const parameters: any[] = [];
|
||||
|
||||
|
|
@ -571,6 +572,7 @@ export class OrderService {
|
|||
o.customer_note as customer_note,
|
||||
o.shipping as shipping,
|
||||
o.billing as billing,
|
||||
o.payment_method as payment_method,
|
||||
cs.order_count as order_count,
|
||||
cs.total_spent as total_spent,
|
||||
COALESCE(
|
||||
|
|
@ -632,6 +634,10 @@ export class OrderService {
|
|||
totalQuery += ` AND o.date_created <= ?`;
|
||||
parameters.push(endDate);
|
||||
}
|
||||
if (payment_method) {
|
||||
sqlQuery += ` AND o.payment_method like "%${payment_method}%" `;
|
||||
totalQuery += ` AND o.payment_method like "%${payment_method}%" `;
|
||||
}
|
||||
const user = await this.userModel.findOneBy({id: userId});
|
||||
if (user?.permissions?.includes('order-10-days')) {
|
||||
sqlQuery += ` AND o.date_created >= ?`;
|
||||
|
|
|
|||
Loading…
Reference in New Issue