diff --git a/app/http/controllers/backend/user.go b/app/http/controllers/backend/user.go index 3363402..cc0d898 100644 --- a/app/http/controllers/backend/user.go +++ b/app/http/controllers/backend/user.go @@ -12,7 +12,6 @@ func Login(c *gin.Context) { } func UserList(c *gin.Context) { - request := controllers.GetRequest(c).(backend.UserListRequest) where := map[string]interface{}{ "Mobile": request.Mobile, diff --git a/app/http/middlewares/base.go b/app/http/middlewares/base.go index c990851..14b50b5 100644 --- a/app/http/middlewares/base.go +++ b/app/http/middlewares/base.go @@ -59,7 +59,7 @@ func ValidateRequest() gin.HandlerFunc { return func(c *gin.Context) { var path = c.Request.RequestURI var handler func() interface{} - if strings.Index(path, "api") >= 0 { + if strings.Index(path, "admin") >= 0 { handler = requestmapping.BackendRequestMap[path] } else { handler = requestmapping.FrontRequestMap[path] diff --git a/app/services/user_service.go b/app/services/user_service.go index 75de8d3..e713708 100644 --- a/app/services/user_service.go +++ b/app/services/user_service.go @@ -18,9 +18,11 @@ func GetListByWhere(where map[string]interface{}, page int, limit int) (count in conn := builder.NewCond() UserListInfo := []userinfomodel.UserInfo{} for k, v := range where { - if v != "" { - conn = conn.And(builder.Like{k, fmt.Sprint(v)}) + if v.(string) == "" || v.(float64) == 0 { + continue } + builder.NewCond() + conn = conn.And(builder.Like{k, fmt.Sprint(v)}) } session := userinfomodel.GetInstance().GetDb().Where(conn)