我在php and应用程序中使用Propel 2 ORM,在某个查询中,我喜欢按字段对结果进行排序。MyClassQuery::create() //->orderByField("Id", $orderedIdArray) --> method does not exist in Propel我在网上找到了一个解决方案,通过推动Peer
我有两个表:食物(id,名称),评论(user_id,food_id,rating)。现在我想将食品表与评论表连接起来,并将虚拟列添加到名为avg_rating的食品表中,这将明显地保持基于评论的食物的平均评级的值。所以我的想法是这样做: ->filterById(15) // constant for testing purposes only ->withColumn("AVG(review.rating)"