Browse Source

feat:z增加limit

zhangxinlei1996 2 năm trước cách đây
mục cha
commit
4a44fb2c6c
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      service/portrait.go

+ 3 - 2
service/portrait.go

@@ -116,10 +116,11 @@ func (this *PortraitService) List(companyName string, pageSize, pageNum int64, i
 	if isExport {
 	if isExport {
 		start, limit = 0, entity.DataExportNumLimit
 		start, limit = 0, entity.DataExportNumLimit
 		fields = `"_id","title"`
 		fields = `"_id","title"`
-	} else {
-		limit = 500
 	}
 	}
 	list := &[]*entity.GetNewMsgList{}
 	list := &[]*entity.GetNewMsgList{}
+	if start > entity.DataExportBatchSearchLimit {
+		return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
+	}
 	//列表查询
 	//列表查询
 	listQuery := fmt.Sprintf(entity.NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(entity.ListSearchLimit, fields, "publishtime", start, limit))
 	listQuery := fmt.Sprintf(entity.NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(entity.ListSearchLimit, fields, "publishtime", start, limit))
 	logx.Infof("PortraitWinnerProject GetList Sql %s\n", listQuery)
 	logx.Infof("PortraitWinnerProject GetList Sql %s\n", listQuery)