Skip to content

Instantly share code, notes, and snippets.

@Wpkenpachi
Created December 1, 2017 19:18
Show Gist options
  • Save Wpkenpachi/95a5199ee81b1f92c78e2cb4f439079a to your computer and use it in GitHub Desktop.
Save Wpkenpachi/95a5199ee81b1f92c78e2cb4f439079a to your computer and use it in GitHub Desktop.
Avaliacao::select("
UNIX_TIMESTAMP( CONVERT_TZ( time, '+00:00', @@global.time_zone) ) as time,
idrest,
idcliente,
comentario,
alias,
entrega,
comida,
embalagem,
custobeneficio,
hasreply,
pedido
")
->with(['respostas' => function($model){
$model->select("
UNIX_TIMESTAMP( CONVERT_TZ( time, '+00:00', @@global.time_zone) ) as time,
idcomentario,
idrest,
idcliente,
comentario,
")->get();
}])
->offset($offset)
->limit(40)
->get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment