Merge pull request #154 from wenjianzhang/v1
fix: Invalid job search criteria
This commit is contained in:
3 files changed
+11
-5
No files matched your search
+7
-4
@@ -10,9 +10,10 @@ import (
|
|||||||
// @Summary 职位列表数据
|
// @Summary 职位列表数据
|
||||||
// @Description 获取JSON
|
// @Description 获取JSON
|
||||||
// @Tags 职位
|
// @Tags 职位
|
||||||
// @Param name query string false "name"
|
// @Param postName query string false "postName"
|
||||||
// @Param id query string false "id"
|
// @Param postCode query string false "postCode"
|
||||||
// @Param position query string false "position"
|
// @Param postId query string false "postId"
|
||||||
|
// @Param status query string false "status"
|
||||||
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
|
||||||
// @Router /api/v1/post [get]
|
// @Router /api/v1/post [get]
|
||||||
// @Security
|
// @Security
|
||||||
@@ -30,11 +31,13 @@ func GetPostList(c *gin.Context) {
|
|||||||
pageIndex = tools.StrToInt(err, index)
|
pageIndex = tools.StrToInt(err, index)
|
||||||
}
|
}
|
||||||
|
|
||||||
data.PostName = c.Request.FormValue("postName")
|
|
||||||
id := c.Request.FormValue("postId")
|
id := c.Request.FormValue("postId")
|
||||||
data.PostId, _ = tools.StringToInt(id)
|
data.PostId, _ = tools.StringToInt(id)
|
||||||
|
|
||||||
|
data.PostCode = c.Request.FormValue("postCode")
|
||||||
data.PostName = c.Request.FormValue("postName")
|
data.PostName = c.Request.FormValue("postName")
|
||||||
|
data.Status = c.Request.FormValue("status")
|
||||||
|
|
||||||
data.DataScope = tools.GetUserIdStr(c)
|
data.DataScope = tools.GetUserIdStr(c)
|
||||||
result, count, err := data.GetPage(pageSize, pageIndex)
|
result, count, err := data.GetPage(pageSize, pageIndex)
|
||||||
tools.HasError(err, "", -1)
|
tools.HasError(err, "", -1)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func GetSysUserList(c *gin.Context) {
|
|||||||
pageIndex = tools.StrToInt(err, index)
|
pageIndex = tools.StrToInt(err, index)
|
||||||
}
|
}
|
||||||
|
|
||||||
data.Username = c.Request.FormValue("userName")
|
data.Username = c.Request.FormValue("username")
|
||||||
data.Status = c.Request.FormValue("status")
|
data.Status = c.Request.FormValue("status")
|
||||||
data.Phone = c.Request.FormValue("phone")
|
data.Phone = c.Request.FormValue("phone")
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ func (e *Post) GetPage(pageSize int, pageIndex int) ([]Post, int, error) {
|
|||||||
if e.PostName != "" {
|
if e.PostName != "" {
|
||||||
table = table.Where("post_name = ?", e.PostName)
|
table = table.Where("post_name = ?", e.PostName)
|
||||||
}
|
}
|
||||||
|
if e.PostCode != "" {
|
||||||
|
table = table.Where("post_code = ?", e.PostCode)
|
||||||
|
}
|
||||||
if e.Status != "" {
|
if e.Status != "" {
|
||||||
table = table.Where("status = ?", e.Status)
|
table = table.Where("status = ?", e.Status)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user