From c6e0ada3f75cd4179a482ccf0d4e34038365a896 Mon Sep 17 00:00:00 2001 From: jay Date: Thu, 27 Sep 2018 21:58:59 +0800 Subject: [PATCH] fix query error --- model/lottery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/lottery.go b/model/lottery.go index c09e211..8cc459e 100644 --- a/model/lottery.go +++ b/model/lottery.go @@ -17,7 +17,7 @@ type Lottery struct { // GetRandomLotteryByType - func GetRandomLotteryByType(t string) (p *Lottery, err error) { p = &Lottery{} - err = x.Get(p, `select * from "public"."lottery" where "type" = $1 order random() limit 1`, t) + err = x.Get(p, `select * from "public"."lottery" where "type" = $1 order by random() limit 1`, t) if err == sql.ErrNoRows { return nil, nil }