|
@@ -7,7 +7,6 @@ import (
|
|
|
"eta/eta_api/services"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
- "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -733,8 +732,7 @@ func (this *ClassifyController) ListClassify() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
- pageSize, _ := this.GetInt("PageSize")
|
|
|
- currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+
|
|
|
keyWord := this.GetString("KeyWord")
|
|
|
companyType := this.GetString("CompanyType")
|
|
|
hideDayWeek, _ := this.GetInt("HideDayWeek")
|
|
@@ -743,22 +741,7 @@ func (this *ClassifyController) ListClassify() {
|
|
|
hideDayWeek = 0
|
|
|
}
|
|
|
|
|
|
- var startSize int
|
|
|
- if pageSize <= 0 {
|
|
|
- pageSize = utils.PageSize20
|
|
|
- }
|
|
|
- if currentIndex <= 0 {
|
|
|
- currentIndex = 1
|
|
|
- }
|
|
|
-
|
|
|
- startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
- list, err := models.GetClassifyList(startSize, pageSize, keyWord, companyType, hideDayWeek)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- total, err := models.GetClassifyListCount(keyWord, companyType, hideDayWeek)
|
|
|
+ list, err := models.GetClassifyList(keyWord, companyType, hideDayWeek)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
@@ -772,8 +755,7 @@ func (this *ClassifyController) ListClassify() {
|
|
|
parentIdLen := len(parentIds)
|
|
|
if parentIdLen == 0 {
|
|
|
resp := &models.ClassifyListResp{
|
|
|
- List: list,
|
|
|
- Paging: paging.GetPaging(currentIndex, pageSize, 0),
|
|
|
+ List: list,
|
|
|
}
|
|
|
br.Data = resp
|
|
|
br.Ret = 200
|
|
@@ -863,10 +845,8 @@ func (this *ClassifyController) ListClassify() {
|
|
|
list[i].Child = childrenMap[list[i].Id]
|
|
|
}
|
|
|
|
|
|
- page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
resp := new(models.ClassifyListResp)
|
|
|
resp.List = list
|
|
|
- resp.Paging = page
|
|
|
br.Data = resp
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|