统计bug修复

This commit is contained in:
Tankaikai
2025-03-26 01:51:42 +08:00
parent d3a27a8b76
commit 55c8a6da90
2 changed files with 4 additions and 0 deletions

View File

@@ -93,6 +93,7 @@
GROUP BY x1.order_id
) t2 on t1.id = t2.order_id
where t1.shop_id = #{shopId}
and t1.status in ('part-refund','refund','done')
<if test="productName != null and productName != ''">
and t2.product_name like concat('%', #{productName}, '%')
</if>
@@ -122,6 +123,7 @@
left join tb_product t2 on t1.product_id = t2.id
left join tb_shop_prod_category t3 on t2.category_id = t3.id
where t1.shop_id = #{shopId}
and t1.status in ('part-refund','refund','done')
<if test="productName != null and productName != ''">
and t1.product_name like concat('%', #{productName}, '%')
</if>
@@ -147,6 +149,7 @@
sum(t1.pay_amount) as amount
from tb_order_detail t1
where t1.shop_id = #{shopId}
and t1.status = 'done'
<if test="beginDate != null and beginDate != ''">
and t1.create_time >= str_to_date(#{beginDate}, '%Y-%m-%d %H:%i:%s')
</if>

View File

@@ -64,6 +64,7 @@
where t1.shop_id = #{shopId}
and t1.table_code is not null
and t2.name is not null
and t1.paid_time is not null
<if test="beginDate != null and beginDate != ''">
AND t1.create_time >= str_to_date(#{beginDate}, '%Y-%m-%d %H:%i:%s')
</if>