我编写了一个查询来返回特定用户购买的所有卡。我不知道我做错了什么。我在cards表中定义了用户id,并手动添加了一些卡片。
我的服务。。
public function getUserCardAction($userId)
{
$card = $this->getCardRepository()
->createQueryBuilder('c')
->select('c')
->where('c.userId = :userId')
->setParameter('userId', $userId)
->getQuery()
->getResult();
return $card;
}
我的控制器。。
public function getUserCard()
{
$this->get('card.configuration')->getUserCardAction($this->getUser());
return $this->success();
}
2条答案
按热度按时间1tuwyuhd1#
我设法找到了解决办法。
我刚刚编辑了我的控制器。
z4bn682m2#
你回来了
那是什么功能?
你不应该返回你的查询结果吗?比如: