🐛 Fix buggy recommendation query statement

This commit is contained in:
LittleSheep 2024-07-23 17:33:17 +08:00
parent 2cf24c4724
commit dda0687b1a
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ func listRecommendationDefault(c *fiber.Ctx) error {
realmId := c.QueryInt("realmId", 0)
maxDownVote := c.QueryInt("maxDownVote", 3)
tx := database.C.Joins("Author").Where("accounts.total_downvote <= ?", maxDownVote)
tx := database.C.Joins("Author").Where("\"Author\".total_downvote <= ?", maxDownVote)
tx = services.FilterPostDraft(tx)
if realmId > 0 {
if realm, err := services.GetRealmWithExtID(uint(realmId)); err != nil {
@ -47,7 +47,7 @@ func listRecommendationShuffle(c *fiber.Ctx) error {
realmId := c.QueryInt("realmId", 0)
maxDownVote := c.QueryInt("maxDownVote", 3)
tx := database.C.Joins("Author").Where("accounts.total_downvote <= ?", maxDownVote)
tx := database.C.Joins("Author").Where("\"Author\".total_downvote <= ?", maxDownVote)
tx = services.FilterPostDraft(tx)
if realmId > 0 {
if realm, err := services.GetRealmWithExtID(uint(realmId)); err != nil {

View File

@ -6,7 +6,7 @@ domain = "im.solsynth.dev"
secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi"
[debug]
database = false
database = true
print_routes = false
[dealer]