Bläddra i källkod

去除未支付的订单统计

李天标 6 år sedan
förälder
incheckning
fbd4bfb1dd
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4 0
      src/main/resources/com/shawn/repository/mybatis/TOrderMapper.xml

+ 4 - 0
src/main/resources/com/shawn/repository/mybatis/TOrderMapper.xml

@@ -745,6 +745,7 @@
   <select id="getMainStatistics" resultMap="chartBean">
     select 'day' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
 where date_format(a.create_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
+    and a.status='1'
     <if test="adminId != null and adminId !=''">
       and a.admin_id= #{adminId} -- 所属商家id
     </if>
@@ -754,6 +755,7 @@ where date_format(a.create_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
 UNION all
 select 'week' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
 where YEARWEEK(date_format(a.create_date,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
+    and a.status='1'
     <if test="adminId != null and adminId !=''">
       and a.admin_id= #{adminId} -- 所属商家id
     </if>
@@ -763,6 +765,7 @@ where YEARWEEK(date_format(a.create_date,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
 UNION all
 select 'month' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
 where date_format(a.create_date,'%Y-%m') = date_format(now(),'%Y-%m')
+    and a.status='1'
     <if test="adminId != null and adminId !=''">
       and a.admin_id= #{adminId} -- 所属商家id
     </if>
@@ -772,6 +775,7 @@ where date_format(a.create_date,'%Y-%m') = date_format(now(),'%Y-%m')
 UNION all
 select 'year' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
 where date_format(a.create_date,'%Y') = date_format(now(),'%Y')
+    and a.status='1'
     <if test="adminId != null and adminId !=''">
       and a.admin_id= #{adminId} -- 所属商家id
     </if>