讨论数量:
select `A`.*, (select count(*) from `B` where `A`.`id` = `B`.`A_id`) as `B_count` from `A
或
\App\Models\A::withCount('b')->get();
select `A`.*, (select count(*) from `B` where `A`.`id` = `B`.`A_id`) as `B_count` from `A
或
\App\Models\A::withCount('b')->get();
或