Created
April 23, 2015 23:34
-
-
Save YuriFontella/282e199bac370e3e6048 to your computer and use it in GitHub Desktop.
soluções do caso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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