diff --git a/app/Http/Controllers/CashController.php b/app/Http/Controllers/CashController.php index 3acf9f7..8684f18 100644 --- a/app/Http/Controllers/CashController.php +++ b/app/Http/Controllers/CashController.php @@ -43,7 +43,7 @@ public function dashboard($requestedSnapshot=null) } } - $snapshotDetails = $this->detailsRepository->fromSnapshot($snapshot->cs_id); + $snapshotDetails = $this->detailsRepository->fromSnapshot($snapshot->cs_id); $allSnapshots = $this->repository->all(); $cashArray = [ floatval($snapshot->amount) ]; diff --git a/app/Models/SnapshotDetails.php b/app/Models/SnapshotDetails.php index 31617af..5bb3c95 100644 --- a/app/Models/SnapshotDetails.php +++ b/app/Models/SnapshotDetails.php @@ -11,7 +11,7 @@ class SnapshotDetails extends Model { public function scopeGroup($query, $groupID) { $query->join('cash_snapshots', 'cash_snapshots.cs_id', '=', 'snapshot_details.cs_id') - ->where('group_id', $groupID); + ->where('cash_snapshots.group_id', $groupID); } } \ No newline at end of file diff --git a/app/Repositories/SnapshotDetailsRepository.php b/app/Repositories/SnapshotDetailsRepository.php index 21521e1..a198f6b 100644 --- a/app/Repositories/SnapshotDetailsRepository.php +++ b/app/Repositories/SnapshotDetailsRepository.php @@ -19,6 +19,7 @@ public function fromSnapshot($id) try { return $this->model->group( Session::get('groupID') ) + ->leftJoin('users', 'snapshot_details.user_id', '=', 'users.user_id') ->where('snapshot_details.cs_id', '=', $id) ->get(); } diff --git a/resources/views/cash/app.blade.php b/resources/views/cash/app.blade.php index dde40d2..098de24 100644 --- a/resources/views/cash/app.blade.php +++ b/resources/views/cash/app.blade.php @@ -42,7 +42,9 @@