转 thinkphp6 和 thinkcmf6 多表联查并获取指定字段
是 thinkphp6 多表联查并获取指定字段|用field('a.*,c.category_id')指定要查询的字段
$articles=\think\facade\Db::table('cmf_portal_post')
->alias('a')
->join('cmf_portal_category_post c','a.id = c.post_id')
->where('c.category_id',$id)
->where('a.post_type',1)
->where('a.post_status',1)
->field('a.*,c.category_id')
->select();-------------------------------------------------------------...
浏览更多内容请先登录。
立即注册
更新于:2023-07-30 20:19:20
相关内容
推荐内容