Explorar o código

wip:随机数

wangshan hai 6 meses
pai
achega
928d167851
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/jfw/modules/publicapply/src/detail/dao/ahead.go

+ 1 - 1
src/jfw/modules/publicapply/src/detail/dao/ahead.go

@@ -143,7 +143,7 @@ func (a *AheadStruct) Ahead() (eri *entity.AheadRecommend) {
 	if eri.More {
 		ri := 0
 		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)]
 	}