|
@@ -993,9 +993,9 @@
|
|
|
IFNULL(orderYesr.orderCountYesr,0) AS orderCountYear,
|
|
|
IFNULL(orderTotal.payTotal,0) AS payTotal,
|
|
|
pb.pageLabel,
|
|
|
- MAX(cor.orderTime) AS lastOrderTime
|
|
|
+ ordr.lastOrderTime AS lastOrderTime
|
|
|
FROM club c
|
|
|
- LEFT JOIN cm_order cor ON c.userID = cor.userID
|
|
|
+# LEFT JOIN cm_order cor ON c.userID = cor.userID
|
|
|
LEFT JOIN USER u ON u.userId=c.userId
|
|
|
LEFT JOIN cm_svip_user csu ON csu.userId = u.userID
|
|
|
LEFT JOIN serviceprovider sp ON sp.serviceProviderID = c.spID
|
|
@@ -1045,6 +1045,10 @@
|
|
|
LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
<where> cbr.userID = c.userID</where>
|
|
|
GROUP BY cbr.pageLabel) AS pb ON c.userID = pb.userID
|
|
|
+
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT userID, MAX(orderTime) AS lastOrderTime FROM cm_order GROUP BY userID
|
|
|
+ ) AS ordr ON c.userID = ordr.userID
|
|
|
<where>
|
|
|
<if test="registerStartTime != null and registerStartTime != ''">
|
|
|
AND (c.addTime > #{registerStartTime} or c.addTime = #{registerStartTime} )
|
|
@@ -1053,10 +1057,10 @@
|
|
|
AND c.addTime <![CDATA[ <= ]]> #{registerEndTime}
|
|
|
</if>
|
|
|
<if test="searchStartTime != null and searchStartTime != ''">
|
|
|
- AND (cor.orderTime > #{searchStartTime} or cor.orderTime = #{searchStartTime} )
|
|
|
+ AND (ordr.lastOrderTime > #{searchStartTime} or ordr.lastOrderTime = #{searchStartTime} )
|
|
|
</if>
|
|
|
<if test=" searchEndTime != null and searchEndTime != ''">
|
|
|
- AND cor.orderTime <![CDATA[ <= ]]> #{searchEndTime}
|
|
|
+ AND ordr.lastOrderTime <![CDATA[ <= ]]> #{searchEndTime}
|
|
|
</if>
|
|
|
<if test="customerValue != null and customerValue != ''">
|
|
|
AND c.firstClubType = #{customerValue}
|
|
@@ -1119,6 +1123,6 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
</where>
|
|
|
- GROUP BY c.userID ORDER BY MAX(cor.orderTime) DESC
|
|
|
+ GROUP BY c.userID ORDER BY ordr.lastOrderTime DESC
|
|
|
</select>
|
|
|
</mapper>
|