From dad1ffb355fdc24bec2158f7764091a3fce6a995 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 25 Nov 2015 02:38:13 -0800 Subject: [PATCH] Specify table name in select to prevent id overwriting --- app/controllers/admin/AccessoriesController.php | 2 +- app/controllers/admin/AssetsController.php | 2 +- app/controllers/admin/ConsumablesController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/AccessoriesController.php b/app/controllers/admin/AccessoriesController.php index 2de2fb2a5f..80d907d219 100755 --- a/app/controllers/admin/AccessoriesController.php +++ b/app/controllers/admin/AccessoriesController.php @@ -542,7 +542,7 @@ class AccessoriesController extends AdminController public function getDatatable() { - $accessories = Accessory::with('category', 'company') + $accessories = Accessory::select('accessories.*')->with('category', 'company') ->whereNull('accessories.deleted_at'); if (Input::has('search')) { diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index 1d3bb5ec93..5034b823bf 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -1198,7 +1198,7 @@ class AssetsController extends AdminController { - $assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category','assetstatus','assetloc', 'company') + $assets = Asset::select('assets.*')->with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category','assetstatus','assetloc', 'company') ->Hardware(); if (Input::has('search')) { diff --git a/app/controllers/admin/ConsumablesController.php b/app/controllers/admin/ConsumablesController.php index 4e7f0418e2..b0ddb1dc1a 100644 --- a/app/controllers/admin/ConsumablesController.php +++ b/app/controllers/admin/ConsumablesController.php @@ -400,7 +400,7 @@ class ConsumablesController extends AdminController public function getDatatable() { - $consumables = Consumable::whereNull('consumables.deleted_at') + $consumables = Consumable::select('consumables.*')->whereNull('consumables.deleted_at') ->with('company','location','category','users'); if (Input::has('search')) {