Created
October 18, 2016 07:25
-
-
Save raank/559ff0a64e6596bf8c88a66eab9d1a21 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
class DadosAnuncios { | |
public function index() | |
{ | |
$confirmeds = Anuncios::where('confirmed', true)->get(); | |
foreach($confirmeds as $items) { | |
if( $items['genero'] == 'masc') { | |
$masc[] = $items; | |
} else { | |
$fem[] = $items; | |
} | |
} | |
return [ | |
'confirmeds' => $confirmeds->count(), | |
'masc' => (isset($masc) ? count($masc) : 0), | |
'fem' => (isset($fem) ? count($fem) : 0) | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment