今月中に誕生日を迎える学生を一覧表示するモデルを作成しています。ただし、実際に一致するものもありますが、これはレコードを返しません。これは、addExpressionからの2つのフィールドに基づいて条件を追加する正しい方法ではありません。 ?正しい方法は何ですか?
class Model_Student_ThisMonthBirthday extends Model_Student {
function init(){
parent::init();
$this->addExpression('birthdayMonth')->set("month(birthDate)");
$this->addExpression('currentMonth')->set("month(now())");
$this->addCondition('birthdayMonth','currentMonth');
}
}