Fix user export

This commit is contained in:
snipe 2017-03-03 19:54:06 -08:00
parent 318ac2be9a
commit 01ae8802c1

View file

@ -1078,6 +1078,7 @@ class UsersController extends Controller
*/ */
public function getExportUserCsv() public function getExportUserCsv()
{ {
$this->authorize('view', User::class); $this->authorize('view', User::class);
\Debugbar::disable(); \Debugbar::disable();
@ -1085,7 +1086,7 @@ class UsersController extends Controller
// Open output stream // Open output stream
$handle = fopen('php://output', 'w'); $handle = fopen('php://output', 'w');
User::with('assignedAssets', 'accessories', 'consumables', 'licenses', 'manager', 'groups', 'userloc', 'company','throttle')->orderBy('created_at', 'DESC')->chunk(500, function($users) use($handle) { User::with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'groups', 'userloc', 'company','throttle')->orderBy('created_at', 'DESC')->chunk(500, function($users) use($handle) {
$headers=[ $headers=[
// strtolower to prevent Excel from trying to open it as a SYLK file // strtolower to prevent Excel from trying to open it as a SYLK file
strtolower(trans('general.id')), strtolower(trans('general.id')),