|
@@ -7,6 +7,7 @@ import (
|
|
|
"eta/eta_hub/utils"
|
|
|
"fmt"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -20,6 +21,8 @@ type EnglishReportController struct {
|
|
|
// @Description 报告列表
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
+// @Param Keyword query string false "搜索关键词"
|
|
|
+// @Param State query int false "状态"
|
|
|
// @Success 200 {object} models.EnglishReportListResp
|
|
|
// @router /list [get]
|
|
|
func (this *EnglishReportController) List() {
|
|
@@ -43,6 +46,18 @@ func (this *EnglishReportController) List() {
|
|
|
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
+ keyword := this.GetString("Keyword")
|
|
|
+ keyword = strings.TrimSpace(keyword)
|
|
|
+ if keyword != "" {
|
|
|
+ kw := fmt.Sprint("%", keyword, "%")
|
|
|
+ condition += ` AND title LIKE ? `
|
|
|
+ pars = append(pars, kw)
|
|
|
+ }
|
|
|
+ state, _ := this.GetInt("State")
|
|
|
+ if state > 0 {
|
|
|
+ condition += ` AND state = ? `
|
|
|
+ pars = append(pars, state)
|
|
|
+ }
|
|
|
|
|
|
reportOb := new(models.EnglishReport)
|
|
|
total, e := reportOb.GetCountByCondition(condition, pars)
|