Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Numeric Sorting in Tables #695

Merged
merged 5 commits into from
Nov 10, 2023

Conversation

BaksiLi
Copy link
Contributor

@BaksiLi BaksiLi commented Nov 9, 2023

There was an issue with the sorting function in the user table where numeric values were being treated as strings, leading to incorrect order.

Specifically, "10" was being sorted next to "1", rather than after "9".
Screenshot 2023-11-10 at 04 12 58

This PR ensures that both numeric and string values are sorted correctly in the user table. See below:

Screenshot 2023-11-10 at 04 09 57

@BaksiLi
Copy link
Contributor Author

BaksiLi commented Nov 9, 2023

I noticed that similar sorting functions are used in other tables.

Among which the channel sorting method (681fcab) already takes into account the numeric case. For the sake of consistency across all tables, I've revised the sorting mechanism to align with the approach used in other tables.

@BaksiLi BaksiLi changed the title Fix Numeric Sorting in User Table fix: Numeric Sorting in Tables Nov 9, 2023
@songquanpeng songquanpeng merged commit 7c4505b into songquanpeng:main Nov 10, 2023
@songquanpeng
Copy link
Owner

Thx~

ckt1031 pushed a commit to ckt1031/one-api that referenced this pull request Nov 10, 2023
* Update sorting method for id

* Update sorting method for id (token)

* Update sorting method for id (redemptions)

* Update sorting method for id (channel)

* chore: use same logic for all tables

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
humphery755 added a commit to humphery755/one-api that referenced this pull request Nov 19, 2023
…ync-one-api

* 'main' of https://github.com/songquanpeng/one-api:
  fix: cloudflare test & expose detailed info about test failures (songquanpeng#715)
  feat: support tts model (songquanpeng#713)
  feat: keep sync with dall-e updates (songquanpeng#679)
  fix: fix PaLM not working issue (songquanpeng#667)
  fix: fix channel_id column name (songquanpeng#681, close songquanpeng#688)
  feat: add improve docker-compose.yml and support fast startup (songquanpeng#685)
  docs: add deploy to zeabur button (songquanpeng#693)
  fix: numeric sorting in tables (songquanpeng#695)
  feat: sync pricing for new 1106 models (songquanpeng#696)
  docs: update readme
  chore: update quota calc logic (close songquanpeng#599) (songquanpeng#627)
  fix: fix Cloudflare AI Gateway channel test support (songquanpeng#639)
  feat: support chatglm_turbo (songquanpeng#648)
  fix: fix typo (songquanpeng#651)
greeeds pushed a commit to greeeds/one-api that referenced this pull request Mar 3, 2024
* Update sorting method for id

* Update sorting method for id (token)

* Update sorting method for id (redemptions)

* Update sorting method for id (channel)

* chore: use same logic for all tables

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants