mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Add filter to only get Assets for the unaccepted assets report
This commit is contained in:
parent
4644f1479b
commit
1453b36484
|
@ -939,9 +939,9 @@ class ReportsController extends Controller
|
||||||
* Get all assets with pending checkout acceptances
|
* Get all assets with pending checkout acceptances
|
||||||
*/
|
*/
|
||||||
if($showDeleted) {
|
if($showDeleted) {
|
||||||
$acceptances = CheckoutAcceptance::pending()->withTrashed()->with(['assignedTo' , 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
$acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->withTrashed()->with(['assignedTo' , 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
||||||
} else {
|
} else {
|
||||||
$acceptances = CheckoutAcceptance::pending()->with(['assignedTo' => function ($query) {
|
$acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->with(['assignedTo' => function ($query) {
|
||||||
$query->withTrashed();
|
$query->withTrashed();
|
||||||
}, 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
}, 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue