|
@@ -4,12 +4,12 @@
|
|
|
|
|
|
|
|
|
<select id="selectBuyOne" resultType="com.bofeng.entity.Buy">
|
|
|
- select * from jm_buy where user_id=#{userId} and jm_id=#{jmId} limit 1
|
|
|
+ select * from jm_buy where user_id=#{userId} and jm_id=#{jmId} and buy_status=1 limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="group" resultType="com.bofeng.entity.JmTuangou">
|
|
|
select *,
|
|
|
- IFNULL((select SUM(jb.buy_count) FROM jm_buy jb where jb.jm_id=jt.jm_id),0) as count
|
|
|
+ IFNULL((select SUM(jb.buy_count) FROM jm_buy jb where jb.jm_id=jt.jm_id and buy_status=1),0) as count
|
|
|
FROM jm_tuangou jt
|
|
|
where jt.uptown_id =(select c.uptown_id
|
|
|
from sys_user_role a
|
|
@@ -22,7 +22,7 @@
|
|
|
select DISTINCT a.tg_title,b.time_create,a.tg_status,a.jm_id,b.buy_status
|
|
|
from jm_tuangou a
|
|
|
INNER JOIN jm_buy b on a.jm_id=b.jm_id
|
|
|
- where a.user_id=#{userId}
|
|
|
+ where a.user_id=#{userId} and buy_status=1
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -37,7 +37,7 @@
|
|
|
<select id="status" resultType="com.bofeng.entity.Buy">
|
|
|
SELECT a.tg_status,a.tg_price,
|
|
|
IFNULL(( SELECT SUM(b.buy_count)
|
|
|
- FROM jm_buy b WHERE a.jm_id = b.jm_id ), 0 ) AS count
|
|
|
+ FROM jm_buy b WHERE a.jm_id = b.jm_id and buy_status=1), 0 ) AS count
|
|
|
FROM jm_tuangou a
|
|
|
WHERE a.jm_id = #{jmId} limit 1
|
|
|
</select>
|