From f27c390100838b75c468ce92330276b68e476ef5 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 15 十月 2019 10:20:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderCountMapper.xml |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderCountMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderCountMapper.xml
index b2768bb..bdb17b3 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderCountMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderCountMapper.xml
@@ -175,10 +175,11 @@
 	</select>
 	
 	<select id="countValidOrderByDate" resultType="Long">
-		SELECT IFNULL(COUNT(co.`co_id`),0) FROM yeshi_ec_common_order co 
-		LEFT JOIN  yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id`
-		LEFT JOIN yeshi_ec_hongbao_v2 v2 ON  v2.hb_id=ho.`ho_hongbao_id` 
-		WHERE co.`co_uid` = #{uid} AND v2.`hb_type` = 1 AND v2.`hb_state` = 3
-			  AND co.`co_third_create_time` > #{dateTime}
+		SELECT IFNULL(COUNT(co_order_no),0) FROM
+			(SELECT DISTINCT co.co_order_no FROM yeshi_ec_common_order co 
+			 LEFT JOIN  yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id`
+			 LEFT JOIN yeshi_ec_hongbao_v2 v2 ON  v2.hb_id=ho.`ho_hongbao_id` 
+			 WHERE co.`co_uid` = #{uid} AND v2.`hb_type` = 1 
+				   AND v2.`hb_state` = 3 AND  AND co.`co_third_create_time` <![CDATA[>]]> #{dateTime})A
 	</select>
 </mapper>

--
Gitblit v1.8.0