a表:
id username community_id
b表:
id a_id type
c表:
id b_id type
我现在需要查询a表的同时,b表需满足type=2,c表满足type=3
不用join,用模型怎么查呢
我自己在tp5中用了
A::hasWhere('B',function($query){
$query->where('type=2');
})->with(['C',function($query){
$query->where('type=3');
}])->where('community_id=10003')->select()发现with没起作用,求大神帮助 最佳答案