错误:调用int上的成员函数union()
$category = Category::select('name')->count();
$city = City::select('city')->count();
$client = Client::select('name')->count();
$property = Property::select('name')->count()
->union($category)
->union($city)
->union($client)
->get();
dd($property);发布于 2021-01-24 02:26:25
如果你只想要一串计数,工会就不适合你了。Select count(*) from multiple tables
$counts = [
'city' => City::count(),
'category' => Category::count(),
'client' => Client::count(),
'property' => Property::count(),
];没有必要将其保存在一个查询中。
https://stackoverflow.com/questions/65865774
复制相似问题