Skip to content

Instantly share code, notes, and snippets.

@YuriFontella
Created April 23, 2015 23:34
Show Gist options
  • Save YuriFontella/282e199bac370e3e6048 to your computer and use it in GitHub Desktop.
Save YuriFontella/282e199bac370e3e6048 to your computer and use it in GitHub Desktop.
soluções do caso
$query = DB::select('*')
->select(array(DB::expr('LEFT(`descricao`,10)'), 'descricao'))
->from('publics')
->limit(4)
->execute();
------------------------------------------------------------------
public static function publics_slide()
{
$query = DB::select()
->from('publics')
->limit(4)
->execute();
$result = array();
if ($query)
{
foreach($query as $row)
{
$row['descricao'] = Str::truncate($row['descricao'], 10);
$result[] = $row;
}
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment