fix
This commit is contained in:
parent
101024599c
commit
86bbce08ed
@ -30,7 +30,7 @@ func GetRandomLotteryByType(t string) (p *Lottery, err error) {
|
||||
// GetRandomLotteryByTypeAndLimit -
|
||||
func GetRandomLotteryByTypeAndLimit(t string, limit int) (p []*Lottery, err error) {
|
||||
offset := rand.Intn(10)
|
||||
err = x.Select(p, `select * from "public"."lottery" where "type" = $1 order by random() offset $2 limit $3`, t, offset, limit)
|
||||
err = x.Select(&p, `select * from "public"."lottery" where "type" = $1 order by random() offset $2 limit $3`, t, offset, limit)
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, nil
|
||||
}
|
||||
|
@ -343,7 +343,6 @@ func lottery(sub, txt string, s *lineobj.SourceObject) (res string) {
|
||||
if err != nil || arr == nil {
|
||||
return ""
|
||||
}
|
||||
fmt.Println("get number lottery ::::: ", len(arr))
|
||||
|
||||
// shuffle array
|
||||
dest := make([]*model.Lottery, len(arr))
|
||||
@ -353,7 +352,6 @@ func lottery(sub, txt string, s *lineobj.SourceObject) (res string) {
|
||||
}
|
||||
|
||||
data := dest[0]
|
||||
fmt.Println("Get Data :::: ", data)
|
||||
|
||||
conf := config.GetConf()
|
||||
u := conf.URL
|
||||
|
Loading…
Reference in New Issue
Block a user