uint ->int
This commit is contained in:
parent
d8fbc61280
commit
1493c66778
|
@ -11,6 +11,9 @@ type UserListRequest struct {
|
|||
Tel string `json:"tel" form:"tel" example:"155555555"`
|
||||
Status int `json:"status" form:"status" example:"1"`
|
||||
Name string `json:"name" form:"name" example:"46516"`
|
||||
DtalkUserId string `json:"dtalk_user_id"`
|
||||
DtalkDepId string `json:"dtalk_dep_id"`
|
||||
WxOpenId string `json:"wx_open_id"`
|
||||
UserIds []string `json:"user_ids"`
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ func RegisterAdminRoute(router *gin.Engine) {
|
|||
user.POST("/list", backend.UserList)
|
||||
user.POST("/add", backend.UserAdd)
|
||||
user.POST("/edit", backend.UserEdit)
|
||||
user.POST("/del", backend.UserDel)
|
||||
user.DELETE("/del", backend.UserDel)
|
||||
}
|
||||
//数据库管理
|
||||
sql := v1.Group("/sql")
|
||||
|
|
|
@ -12,12 +12,24 @@ import (
|
|||
func GetListByWhere(request *backend.UserListRequest, page int, limit int) (count int64, UserListInfo []cronusermodel.CronUser, err error) {
|
||||
cond := builder.NewCond()
|
||||
|
||||
if request.Name != "" {
|
||||
cond = cond.And(builder.Like{"name", request.Name})
|
||||
}
|
||||
if request.Tel != "" {
|
||||
cond = cond.And(builder.Like{"tel", request.Tel})
|
||||
}
|
||||
if request.Status != 0 {
|
||||
cond = cond.And(builder.Eq{"status": request.Status})
|
||||
}
|
||||
if request.DtalkDepId != "" {
|
||||
cond = cond.And(builder.Like{"dtalk_dep_id", request.DtalkDepId})
|
||||
}
|
||||
if request.DtalkUserId != "" {
|
||||
cond = cond.And(builder.Like{"dtalk_user_id", request.DtalkUserId})
|
||||
}
|
||||
if request.DtalkUserId != "" {
|
||||
cond = cond.And(builder.Like{"dtalk_user_id", request.DtalkUserId})
|
||||
}
|
||||
if len(request.UserIds) > 0 {
|
||||
// 使用IN查询
|
||||
cond = cond.And(builder.In("user_id", request.UserIds))
|
||||
|
|
Loading…
Reference in New Issue