Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/10/2014, 14:26
Avatar de armandoweb
armandoweb
 
Fecha de Ingreso: enero-2003
Ubicación: San Cristobal, Santa Fe, Argentina
Mensajes: 544
Antigüedad: 21 años, 3 meses
Puntos: 7
Respuesta: Generar array con datos de una consulta

Esta es la consulta que hago:

Código PHP:
Ver original
  1. $trabajos = DB::table('trabajos')
  2.     ->join('tecnicos', 'trabajos.responsable_diagnostico', '=', 'tecnicos.id')
  3.     ->where('trabajos.created_at', '>=', $desde4, 'and', 'trabajos.created_at', '<=', $hasta4)
  4.     ->select('trabajos.fecha_ingreso', 'trabajos.hora_ingreso', 'tecnicos.nombre', 'trabajos.fecha_egreso', 'trabajos.hora_egreso')
  5.     ->get();

y este es el objeto que arroja:

Código PHP:
Ver original
  1. (
  2.     [0] => stdClass Object
  3.         (
  4.             [fecha_ingreso] => 10/10/2014
  5.             [hora_ingreso] => 12:30
  6.             [nombre] => Juan Uranda
  7.             [fecha_egreso] => 10/10/2014
  8.             [hora_egreso] => 12:50
  9.         )
  10.  
  11.     [1] => stdClass Object
  12.         (
  13.             [fecha_ingreso] => 16/10/2014
  14.             [hora_ingreso] => 12:30
  15.             [nombre] => Juan Uranda
  16.             [fecha_egreso] => 16/10/2014
  17.             [hora_egreso] => 13:00
  18.         )
  19.  
  20.     [2] => stdClass Object
  21.         (
  22.             [fecha_ingreso] => 31/10/2014
  23.             [hora_ingreso] => 12:30
  24.             [nombre] => Martin Perez
  25.             [fecha_egreso] => 31/10/2014
  26.             [hora_egreso] => 13:50
  27.         )
  28.  
  29. )

Eso es lo que necesitas saber?
__________________
www.awdesarrollos.com.ar - [twitter: @armandoweb] - [Skype: awdesarrollos"]