Эх сурвалжийг харах

Merge branch 'refs/heads/eta_2.0.7_fenwei_0820@guomengyuan' into debug

gmy 7 сар өмнө
parent
commit
500551c402

+ 4 - 4
controllers/data_manage/fenwei_data.go

@@ -1013,7 +1013,7 @@ func (this *EdbInfoController) GetFenWeiIndexInfo() {
 		return
 	}
 
-	pageSize, _ := this.GetInt("PageSize")
+	/*pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 
 	if pageSize <= 0 {
@@ -1021,7 +1021,7 @@ func (this *EdbInfoController) GetFenWeiIndexInfo() {
 	}
 	if currentIndex <= 0 {
 		currentIndex = 1
-	}
+	}*/
 
 	keyWord := this.GetString("KeyWord")
 	classifyIds := this.GetString("ClassifyIds")
@@ -1035,7 +1035,7 @@ func (this *EdbInfoController) GetFenWeiIndexInfo() {
 	if frequencies != "" {
 		frequencyList = strings.Split(frequencies, ",")
 	}
-	indexInfoPage, err := data.GetFenWeiIndexInfo(keyWord, classifyIdList, frequencyList, currentIndex, pageSize)
+	indexInfoList, err := data.GetFenWeiIndexInfo(keyWord, classifyIdList, frequencyList)
 	if err != nil {
 		return
 	}
@@ -1043,5 +1043,5 @@ func (this *EdbInfoController) GetFenWeiIndexInfo() {
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"
-	br.Data = indexInfoPage
+	br.Data = indexInfoList
 }

+ 3 - 3
models/data_manage/base_from_fenwei.go

@@ -261,14 +261,14 @@ func GetFenWeiDataListByIndexCodes(IndexCodes string) (items []string, err error
 }
 
 // GetFenWeiIndexInfoPage 分页查询指标信息
-func GetFenWeiIndexInfoPage(condition string, pars []interface{}, size int, pageSize int) (items []*BaseFromFenweiIndex, err error) {
+func GetFenWeiIndexInfoPage(condition string, pars []interface{}) (items []*BaseFromFenweiIndex, err error) {
 	o := orm.NewOrmUsingDB("data")
 	sql := ` SELECT * FROM base_from_fenwei_index WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}
-	sql += ` ORDER BY fenwei_index_id asc LIMIT ?,?`
-	_, err = o.Raw(sql, pars, size, pageSize).QueryRows(&items)
+	sql += ` ORDER BY fenwei_index_id asc`
+	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
 
 }

+ 3 - 21
services/data/base_from_fenwei_index_service.go

@@ -6,7 +6,6 @@ import (
 	"eta/eta_api/models/data_manage"
 	"eta/eta_api/utils"
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/paging"
 )
 
 // FenWeiIndexAddValidate 指标添加校验
@@ -122,14 +121,14 @@ func FenWeiIndexAdd(req data_manage.FenWeiIndexAddReq, lang string) (edb *data_m
 	}
 	edb = edbInfo
 
-	// todo EdbInfoAdd方法已经新增es,这里不需要再新增???
+	// EdbInfoAdd方法已经新增es,这里不需要再新增???
 	// 新增es
 	// go AddOrEditEdbInfoToEs(edbInfo.EdbInfoId)
 	return
 }
 
 // GetFenWeiIndexInfo 获取指标信息-分页
-func GetFenWeiIndexInfo(keyWord string, classifyIdList []string, frequencyList []string, currentIndex int, pageSize int) (baseFromFenWeiIndexPage *data_manage.BaseFromFenWeiIndexPage, err error) {
+func GetFenWeiIndexInfo(keyWord string, classifyIdList []string, frequencyList []string) (fenWeiIndexInfoList []*data_manage.BaseFromFenweiIndex, err error) {
 
 	// 获取指标
 	var condition string
@@ -154,27 +153,10 @@ func GetFenWeiIndexInfo(keyWord string, classifyIdList []string, frequencyList [
 		condition = condition[:len(condition)-1] + `)`
 	}
 
-	count, err := data_manage.GetFenWeiIndexInfoCount(condition, pars)
+	fenWeiIndexInfoList, err = data_manage.GetFenWeiIndexInfoPage(condition, pars)
 	if err != nil {
 		return
 	}
-	page := paging.GetPaging(currentIndex, pageSize, count)
-	if count <= 0 {
-		baseFromFenWeiIndexPage = &data_manage.BaseFromFenWeiIndexPage{
-			List:   []*data_manage.BaseFromFenweiIndex{},
-			Paging: page,
-		}
-		return
-	}
 
-	startSize := utils.StartIndex(currentIndex, pageSize)
-	fenWeiIndexInfoList, err := data_manage.GetFenWeiIndexInfoPage(condition, pars, startSize, pageSize)
-	if err != nil {
-		return
-	}
-	baseFromFenWeiIndexPage = &data_manage.BaseFromFenWeiIndexPage{
-		List:   fenWeiIndexInfoList,
-		Paging: page,
-	}
 	return
 }