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);
我只需要添加额外的参数吗?但我不知道如何得到几个月前的日期。