0
I would like to make a condition where only show the birthday of the month. My controller looked like this:
public function index()
{
$ultimoDia = date("t", mktime(0,0,0,date('m'),'01',date('Y')));
$condicoes['order'] = array('Funcionario.NomFun' => 'ASC');
$condicoes['conditions'] = array(
'Funcionario.SitAfa <>' => 7,
'Funcionario.datNasc >=' => date("m").'-01',
'Funcionario.datNasc <=' => date("Y-m").'-'.$ultimoDia
);
$condicoes['limit'] = 60;
var_dump($condicoes['conditions']);
$this->paginate = $condicoes;
$this->set('aniversariantes', $this->paginate());
}
But it does not work it does not list anything because the string it returns is:
'Funcionario.datNasc >=' => string '09-01' (length=5)
'Funcionario.datNasc <=' => string '2015-09-30' (length=10)
and the table datNasc
returns the full employee date ex: string '2015-09-18'.
Perfect guy, thank you so much.
– Rodrigo Gaster