Skip to content

Commit

Permalink
add restrictions that only return non-expired members
Browse files Browse the repository at this point in the history
  • Loading branch information
sunjiayu committed Nov 19, 2024
1 parent 8a6c09c commit 4b70a35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ func (server PlatformService) WhitelistMySqlUpdate(ctx *context.Context, data *W
func (server PlatformService) WhitelistMySqlQuery(ctx *context.Context, data *WhitelistUserData) ([]WhitelistUserData, error) {
var queryCmd string
if data.OpenID == nil {
queryCmd = "SELECT * FROM whitelist_user;"
queryCmd = "SELECT * FROM whitelist_user WHERE expiration_date > UNIX_TIMESTAMP(NOW());"
} else {
queryCmd = fmt.Sprintf("SELECT * FROM whitelist_user WHERE openid='%s';", *data.OpenID)
queryCmd = fmt.Sprintf("SELECT * FROM whitelist_user WHERE openid='%s' AND expiration_date > UNIX_TIMESTAMP(NOW());", *data.OpenID)
}
rows, err := server.db.QueryContext(*ctx, queryCmd)
if err != nil {
Expand Down

0 comments on commit 4b70a35

Please sign in to comment.