修改首页 新增好友总数与好友列表的总数对不上问题。

master
kevin jiang 6 years ago
parent cbc4c4d954
commit fb86e51ac9

@ -290,13 +290,14 @@
</select> </select>
<select id="selectWxSumCusNumByConditionShopManager" resultType="java.lang.Integer"> <select id="selectWxSumCusNumByConditionShopManager" resultType="java.lang.Integer">
SELECT count(customer_id) from op_seller_customer_relation SELECT count(customer_id) from op_seller_customer_relation t, op_customer t2
WHERE store_id = #{storeId} WHERE t.store_id = #{storeId}
and t.customer_id = t2.id
<if test="startDate != null"> <if test="startDate != null">
and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate},'%Y-%m-%d') and DATE_FORMAT(t2.create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate},'%Y-%m-%d')
</if> </if>
<if test="endDate != null"> <if test="endDate != null">
and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d') and DATE_FORMAT(t2.create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d')
</if> </if>
group by store_id group by store_id
</select> </select>
@ -366,12 +367,13 @@
t1.id AS storeId t1.id AS storeId
FROM FROM
poi_store t1 poi_store t1
LEFT JOIN `op_seller_customer_relation` t2 ON t1.id = t2.store_id JOIN `op_seller_customer_relation` t2 ON t1.id = t2.store_id
JOIN op_customer t3 on t2.customer_id = t3.id
<if test="startDate != null"> <if test="startDate != null">
and DATE_FORMAT(t2.create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate},'%Y-%m-%d') and DATE_FORMAT(t3.create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startDate},'%Y-%m-%d')
</if> </if>
<if test="endDate != null"> <if test="endDate != null">
and DATE_FORMAT(t2.create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d') and DATE_FORMAT(t3.create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d')
</if> </if>
WHERE WHERE
t1.STATUS = 1 t1.STATUS = 1

Loading…
Cancel
Save