当我跑步时:
{
"rules": {
"updates": {
"$location_id": { // $location_id should act like a wild card
".indexOn": ["validFrom"]
}
}
}
}
它产生以下结构:
$this->createQueryBuilder('debtor')
->join('debtor.deals', 'deal')
->addSelect('...something... as closed_deals_count')
->getQuery()
->getSingleResult()
我怎么能用' closed_deals_count'来获得单一的债务人记录?在它而不是数组?
答案 0 :(得分:0)
我认为你正在寻找getSingleScalarResult
。类似的东西:
$this->createQueryBuilder('debtor')
->join('debtor.deals', 'deal')
->addSelect('COUNT(deal.id) as closed_deals_count')
->getQuery()
->getSingleScalarResult()