From e560cc2ee250cc80e91843603cc3aa7ac0b343cf Mon Sep 17 00:00:00 2001 From: Vincent Sposato Date: Fri, 31 Jul 2015 19:29:44 -0400 Subject: [PATCH] Working on the Actionlog and ReportsController - still having issues getting data back the way I want --- app/controllers/admin/ReportsController.php | 2 +- app/models/Actionlog.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/ReportsController.php b/app/controllers/admin/ReportsController.php index d25e4ba2b5..aef7e3f3a6 100644 --- a/app/controllers/admin/ReportsController.php +++ b/app/controllers/admin/ReportsController.php @@ -592,12 +592,12 @@ class ReportsController extends AdminController ->get() ->toArray(), 'id' ); - $assetsCheckedOutThatRequireAcceptance = Asset::deployed() ->inModelList( $modelsInCategoriesThatRequireAcceptance ) ->list( 'id', 'assigned_to' ) ->get() ->toArray(); + $assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' ) ->orderBy( 'created_at', 'DESC' ) ->get(); diff --git a/app/models/Actionlog.php b/app/models/Actionlog.php index 10b792ae9a..69a78793c6 100755 --- a/app/models/Actionlog.php +++ b/app/models/Actionlog.php @@ -1,5 +1,6 @@ select( '*' ) + ->orderBy( 'asset_id', 'asc' ) + ->orderBy( 'created_at', 'asc' ) + ->get(); + } + public function getLatestCheckoutActionForAssets() { @@ -108,4 +117,5 @@ return $query->where( 'action_type', '=', 'checkout' ) ->where( 'accepted_id', '=', null ); } + }