fix query error

This commit is contained in:
Jay 2018-09-27 21:58:59 +08:00
parent c233fa0cfb
commit c6e0ada3f7

View File

@ -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
}