소스 검색

商品列表排序规则优化bugfix

chao 3 년 전
부모
커밋
6799918733
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/main/resources/mapper/SearchMapper.xml

+ 2 - 2
src/main/resources/mapper/SearchMapper.xml

@@ -544,9 +544,9 @@
         limit 1
     </select>
     <select id="countViewsByDate" resultType="java.lang.Integer">
-        select sum(views) from cm_product_views_record where productId = #{productId} and viewTime > #{date}
+        select IFNULL(sum(views),0) from cm_product_views_record where productId = #{productId} and viewTime > #{date}
     </select>
     <select id="countSalesByDate" resultType="java.lang.Integer">
-        select sum(sales) from cm_product_sales_record where productId = #{productId} and saleTime > #{date}
+        select IFNULL(sum(sales),0) from cm_product_sales_record where productId = #{productId} and saleTime > #{date}
     </select>
 </mapper>