浏览代码

业主购买2月10号

guojing 5 年之前
父节点
当前提交
b5c9ee7b1d
共有 2 个文件被更改,包括 8 次插入11 次删除
  1. 3 3
      whepi-ui/templates/home/buyClient.ftl
  2. 5 8
      whepi-web/src/main/resources/mapper/BuyMapper.xml

+ 3 - 3
whepi-ui/templates/home/buyClient.ftl

@@ -73,9 +73,9 @@
             type: 'GET',
             success: function (data) {
                 console.log(data);
-                $("#Buycount").html(data.data.count)
-                $("#myStatus").html(getStatus(data.data.tgStatus))
-                $("#myPhone").val(data.data.phone)
+                $("#Buycount").html(data.data.count);
+                $("#myStatus").html(getStatus(data.data.tgStatus));
+                $("#myPhone").val(data.data.phone);
             },
             error: function () {
             }

+ 5 - 8
whepi-web/src/main/resources/mapper/BuyMapper.xml

@@ -32,14 +32,11 @@
     </select>
 
     <select id="status" resultType="com.bofeng.entity.Buy">
-      SELECT a.tg_status,a.tg_price,e.phone,
-      IFNULL(( SELECT SUM(b.buy_count)
-      FROM jm_buy b WHERE a.jm_id = b.jm_id and buy_status=1), 0 ) AS count
-      FROM jm_tuangou a
-      INNER JOIN jm_buy c on a.jm_id=c.jm_id and c.user_id=#{userId}
-	  INNER JOIN sys_user_role d on d.user_id=c.user_id and d.role_id=1
-	  INNER JOIN sys_uptown_home e on e.house_id=d.property_id
-      WHERE a.jm_id = #{jmId} limit 1
+       SELECT a.tg_status, a.tg_price, IFNULL(( SELECT SUM(b.buy_count) FROM jm_buy b WHERE a.jm_id = b.jm_id AND buy_status = 1 ), 0 ) AS count,
+       ( SELECT phone FROM sys_user_role aa INNER JOIN sys_uptown_home bb ON aa.property_id = bb.house_id WHERE aa.role_id = 1 AND aa.user_id = #{userId}
+       LIMIT 1 ) AS phone FROM jm_tuangou a WHERE a.jm_id = #{jmId}
+       AND a.user_id = #{userId}
+       LIMIT 1
     </select>
 
     <select id="selectCountNum" resultType="com.bofeng.entity.Buy">