mysql小白希望查詢出文章留言的排行榜希望找個(gè)大神指導(dǎo)一下。comments評(píng)論表Schema::create('comments',function(Blueprint$table){$table->increments('id');$table->string('post_id')->notNull()->comment('文章id');$table->string('body')->notNull()->comment('留言內(nèi)容');$table->timestamps();});posts文章表Schema::create('posts',function(Blueprint$table){$table->increments('id');$table->string('title')->notNull()->comment('文章標(biāo)題');$table->string('body')->notNull()->comment('文章內(nèi)容');$table->timestamps();});democomments表有如下數(shù)據(jù)idpost_idbody11?到此一游22此文嘉獎(jiǎng)31?不錯(cuò)42?不錯(cuò)+151?不錯(cuò)+261?不錯(cuò)+371?不錯(cuò)+4最終希望查詢出如下post_idcomment_count1522
laravel 根據(jù)留言表 查詢出留言最多的文章,熱度排行榜查詢
素胚勾勒不出你
2019-05-25 15:35:23