Explorar o código

商品列表排序规则优化bugfix

chao %!s(int64=3) %!d(string=hai) anos
pai
achega
6799918733
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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>