fix(order): 调整订单查询逻辑以优化状态筛选和时间范围
- 在状态筛选中默认过滤已关闭订单(status !=2) - 修改近三个月订单的时间范围查询逻辑,使用BETWEEN替代>= - 确保订单查询条件更加准确和高效
This commit is contained in:
@@ -221,6 +221,10 @@
|
||||
OR b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="param.statusFilter != 8">
|
||||
<!-- 默认过滤已关闭订单 -->
|
||||
AND a.order_status != 2
|
||||
</if>
|
||||
<!-- 订单状态筛选:-1全部,0待支付,1待发货,2待核销,3待收货,4待评价,5已完成,6已退款,7已删除 -->
|
||||
<if test="param.statusFilter != null and param.statusFilter != -1">
|
||||
<if test="param.statusFilter == 0">
|
||||
@@ -261,7 +265,7 @@
|
||||
</if>
|
||||
<!-- 近三个月订单 -->
|
||||
<if test="param.statusFilter == 9">
|
||||
AND a.create_time >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
|
||||
AND a.create_time BETWEEN DATE_SUB(CURDATE(), INTERVAL 3 MONTH) AND CURDATE()
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
Reference in New Issue
Block a user