|
@@ -92,6 +92,7 @@ func (a *AheadStruct) Ahead() (eri *entity.AheadRecommend) {
|
|
if total > 0 {
|
|
if total > 0 {
|
|
if repl != nil && *repl != nil && len(*repl) > 0 {
|
|
if repl != nil && *repl != nil && len(*repl) > 0 {
|
|
list = a.Format(*repl)
|
|
list = a.Format(*repl)
|
|
|
|
+ total = int64(len(list))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -142,7 +143,7 @@ func (a *AheadStruct) Ahead() (eri *entity.AheadRecommend) {
|
|
if eri.More {
|
|
if eri.More {
|
|
ri := 0
|
|
ri := 0
|
|
if len(eri.List)-int(count) > 1 {
|
|
if len(eri.List)-int(count) > 1 {
|
|
- rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(eri.List) - int(count) - 1)
|
|
|
|
|
|
+ ri = rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(eri.List) - int(count) - 1)
|
|
}
|
|
}
|
|
eri.List = eri.List[ri : ri+int(count)]
|
|
eri.List = eri.List[ri : ri+int(count)]
|
|
}
|
|
}
|