Closed n-hor closed 3 years ago
Hello! Laravel 5.8 In this case it does not work.
pays its a hasManyThrough relation.
$orders->withCount(['pays as pay_sum' => function (Builder $q) { return $q->select(DB::raw('SUM(invoice_pays.sum)')); }])->havingRaw('pay_sum >= `orders`.`amount`');
Column not found: 1054 Unknown column 'orders.amount' in 'having clause'
But of course such a column exists. Everything works well without pagination.
5.8 is EOL, just upgrade and remove this package from your application ;)
Hello! Laravel 5.8 In this case it does not work.
pays its a hasManyThrough relation.
Column not found: 1054 Unknown column 'orders.amount' in 'having clause'
But of course such a column exists. Everything works well without pagination.