lolol i forgot this
This commit is contained in:
parent
a1eb970382
commit
77ba8aee78
|
@ -21,6 +21,7 @@ type Achievement struct {
|
||||||
// amount of time.
|
// amount of time.
|
||||||
func LoadAchievementsEvery(db *sqlx.DB, d time.Duration) {
|
func LoadAchievementsEvery(db *sqlx.DB, d time.Duration) {
|
||||||
for {
|
for {
|
||||||
|
achievs = nil
|
||||||
err := db.Select(&achievs,
|
err := db.Select(&achievs,
|
||||||
"SELECT id, name, description, icon FROM achievements ORDER BY id ASC")
|
"SELECT id, name, description, icon FROM achievements ORDER BY id ASC")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -53,7 +54,7 @@ func UserAchievementsGET(md common.MethodData) common.CodeMessager {
|
||||||
var ids []int
|
var ids []int
|
||||||
err := md.DB.Select(&ids, `SELECT ua.achievement_id FROM users_achievements ua
|
err := md.DB.Select(&ids, `SELECT ua.achievement_id FROM users_achievements ua
|
||||||
INNER JOIN users ON users.id = ua.user_id
|
INNER JOIN users ON users.id = ua.user_id
|
||||||
WHERE `+whereClause, param)
|
WHERE `+whereClause+` ORDER BY ua.achievement_id ASC`, param)
|
||||||
switch {
|
switch {
|
||||||
case err == sql.ErrNoRows:
|
case err == sql.ErrNoRows:
|
||||||
return common.SimpleResponse(404, "No such user!")
|
return common.SimpleResponse(404, "No such user!")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user