1
好日子,獲取學說查詢生成器日期
我想「從現在起2個月以上」得到的日期,在我的學說查詢生成器「從現在起未滿六個月。
我現在擁有的是;
if ($type == 'older_than_two_months') {
$qb->andWhere('i.createdAt < ');
}
if ($type == 'younger_than_six_months') {
$qb->andWhere('i.createdAt > ');
}
$qb->orderBy('i.createdAt', 'DESC')
->setParameter('status', $status);
我只需要添加額外的參數嗎?但我不知道如何得到幾個月前的日期。