php - Using yii CListView to do a parallel sorting problem
PHPz
PHPz 2017-06-05 11:07:53
0
2
970

I want to make a page ranking function. Now the page ranking is successful, but the scores are the same and they cannot be ranked side by side. Please give me some advice. Masters

PHPz
PHPz

学习是最好的投资!

reply all(2)
仅有的幸福

I thought hard for an hour and used a relatively clever way to solve this problem
Don’t touch the original logic, then query it again, sort it in the controller alone, and then pass the value in according to the viewData of CListView. The component loops and then maps the sorting to the template

滿天的星座

If it is like this: 10, 11, 11, 11, 12, 13... Such a transformation is really troublesome after thinking about it. I feel that I can only take out all the data, traverse and re-rank it, and then paginate. Maybe CArrayDataProvider needs to be used to provide data to CList.
If it is other: 10, 11, 11, 11, 14, 15... It is relatively simple to just take out the page and re-traverse the rankings in this page.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template