Php 拉威尔在计数和良好方面有许多错误->;计数()

Php 拉威尔在计数和良好方面有许多错误->;计数(),php,laravel,Php,Laravel,我有很多亲戚 public function orders() { return $this->hasManyThrough(Order::class, Customer::class, 'email', 'customer_id', 'email', 'email'); } 在经历了那样的事情之后 {{ $user->orders->count() }} 我得到了14个定义用户的订单。很好。但是 经过类似的代码 User::withCount('orders')

我有很多亲戚

public function orders()
{
    return $this->hasManyThrough(Order::class, Customer::class, 'email', 'customer_id', 'email', 'email');
}
在经历了那样的事情之后

{{ $user->orders->count() }}

我得到了14个定义用户的订单。很好。但是

经过类似的代码

User::withCount('orders')...
同一用户的计数不同

我在调试栏sql信息中看到错误

应该是users.email=customers.email


是否有办法更改它?

这已在Laravel 5.5.22中修复: