thinkphp5 子查询

  • Post author:
  • Post category:php


$subsql = Db::table('think_work') ->where('status',1) ->field('artist_id,count(id) count') ->group('artist_id') ->buildSql();

 Db::table('think_user') ->alias('a') ->join([$subsql=> 'w'], 'a.artist_id = w.artist_id') ->select();
 



版权声明:本文为weixin_42136237原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。