소스 검색

待评价数量sql修改

hyq 6 년 전
부모
커밋
ed047c39de
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml

+ 2 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml

@@ -554,7 +554,8 @@
 
     <select id="queryUcenterMap" resultType="map">
         select count(a.id) as orders, sum(case a.order_status when 0 then 1 else 0 end ) as unPayNum, sum(case a.order_status when 300 then 1 else 0 end ) as unTakeNum
-        ,sum(case a.order_status when 201 then 1 else 0 end ) as unPaymentNum, sum(case a.order_status when 301 then 1 else 0 end ) as unEvalNum
+        ,sum(case a.order_status when 201 then 1 else 0 end ) as unPaymentNum,
+        sum(case a.order_status when 301 then 1 else 0 end and case a.comment_count when 0 then 1 else 0 end ) as unEvalNum
         from mall_order a
         left join mall_comment b on a.id = b.order_id
         where 1 = 1