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