Browse Source

wip:随机数

wangshan 6 months ago
parent
commit
928d167851
1 changed files with 1 additions and 1 deletions
  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)]
 	}