评论数分页城市等
Posted cnchengv
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了评论数分页城市等相关的知识,希望对你有一定的参考价值。
/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;
以上是关于评论数分页城市等的主要内容,如果未能解决你的问题,请参考以下文章
详情页制作及跳转功能实现《iVX低代码/无代码个人博客制作》