自定义排序方面的问题想请教一下
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.7k
- Forks
- 253
- PR merge metrics
- No merged PRs in 30d
Description
事情是这样的,我自定了一套积分算法:
积分 = 浏览/2 + 点赞 + 收藏*2
然后我想让热门内容按照积分从高到低进行排序
“积分”这个没有在数据库存为字段,如果要在数据库加的话要刷10多万条数据,感觉蛮麻烦的;
如果:
浏览是“click”
点赞是“mark”
收藏是“collection”
积分存为“integral”
请问要怎么写才能让内容按照积分从高到低进行排序
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names the fields click, mark, collection, and integral, but no repository file, test, or entry point. First locate the framework's content data-access and sorting paths, then determine how the requested score ordering should be verified; done means the intended descending ordering is specified and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100