统计用户订单只统计已付款的

master
liuqingkun 2 years ago
parent 10bf5c7225
commit 3c23239d56
  1. 8
      src/main/java/org/springblade/modules/weixin/mapper/WeChatUserMapper.xml

@ -3,9 +3,9 @@
<mapper namespace="org.springblade.modules.weixin.mapper.WeChatUserMapper">
<select id="buyCount" resultType="org.springblade.modules.weixin.dto.BuyCount">
SELECT
a.buyer_phone AS phone,
count(a.buyer_phone) AS count
FROM eh_order AS a WHERE a.is_deleted = 0 GROUP BY a.buyer_phone
SELECT a.buyer_phone AS phone, COUNT(a.buyer_phone) AS `count`
FROM eh_order AS a
WHERE a.is_deleted = 0 AND `status` IN (2, 3, 4)
GROUP BY a.buyer_phone
</select>
</mapper>

Loading…
Cancel
Save