标签:count vue rom image class out HERE inner group
/all
var sqlstr=‘SELECT c.count, user.usrname,i.image,r.* FROM room r LEFT OUTER JOIN (SELECT image,roomid,MIN(id) FROM room_image GROUP BY roomid) i ON r.id=i.roomid ‘
+‘inner join user on r.userid=user.id ‘
+ ‘LEFT OUTER JOIN (SELECT COUNT(roomid) AS COUNT,roomid FROM room_comment GROUP BY roomid) c ON r.id=c.roomid ‘;
vue种
<i v-if="room.count" style="padding-right: 1em" class="el-icon-news">{{room.count}}</i>
room:id里
var sqlstr=‘select c.count, user.usrname, r.* from room r inner join user on r.userid=user.id ‘
+‘LEFT OUTER JOIN (SELECT COUNT(roomid) AS COUNT,roomid FROM room_comment GROUP BY roomid) c ON r.id=c.roomid‘
+‘ where r.id = ‘+roomid;
标签:count vue rom image class out HERE inner group
原文地址:https://www.cnblogs.com/cnchengv/p/8858206.html