0

I have a page where I'm displaying the title of something. Users are allowed to provide their own suggested titles. The title I originally display is stored under the event's object. All suggestions are stored in their own table. Each suggestion has a vote count associated with it. I want to display the original title unless there is a suggestion that is above some threshold of votes, but if several are above that threshold, I want to display the highest one. How would I grab the highest-voted suggestion from the list, but only if it is above some arbitrary threshold, let's say 5?

4

1 回答 1

1

为建议模型的建议数量添加一个整数字段。

然后找到最高的建议并检查它是否超过 5 票

于 2013-06-30T21:04:33.667 回答