Browse Source

update

tmp
DengBiao 9 months ago
parent
commit
092b0f37d7
2 changed files with 27 additions and 6 deletions
  1. +8
    -6
      app/admin/md/md_user.go
  2. +19
    -0
      app/admin/svc/svc_user.go

+ 8
- 6
app/admin/md/md_user.go View File

@@ -1,12 +1,14 @@
package md

type UserListReq struct {
Limit int `json:"limit" binding:"required"`
Page int `json:"page" binding:"required"`
Nickname string `json:"nickname" label:"支付宝昵称"`
Phone string `json:"phone" label:"手机号"`
CreateTimeStart string `json:"create_time_start" label:"创建时间-起始"`
CreateTimeEnd string `json:"create_time_end" label:"创建时间-截止"`
Limit int `json:"limit" binding:"required"`
Page int `json:"page" binding:"required"`
Nickname string `json:"nickname" label:"支付宝昵称"`
Phone string `json:"phone" label:"手机号"`
EnterpriseId int `json:"enterprise_id" label:"企业id"`
UserIdentityName string `json:"user_identity_name" label:"身份名称"`
CreateTimeStart string `json:"create_time_start" label:"创建时间-起始"`
CreateTimeEnd string `json:"create_time_end" label:"创建时间-截止"`
}

type UserListResp struct {


+ 19
- 0
app/admin/svc/svc_user.go View File

@@ -25,6 +25,25 @@ func UserList(req md.UserListReq) (resp md.UserListResp, err error) {
if req.CreateTimeEnd != "" {
sess.And("create_at <= ?", req.CreateTimeEnd)
}
if req.UserIdentityName != "" {
var mm []model.UserIdentity
engine := db.Db.Where("name like ?", "%"+req.UserIdentityName+"%")
if req.EnterpriseId != 0 {
engine = engine.And("enterprise_id =? ", req.EnterpriseId)
}
err = engine.Find(&mm)
if err != nil {
return
}

if len(mm) > 0 {
var userIds []int
for _, v := range mm {
userIds = append(userIds, v.Uid)
}
sess.In("id", userIds)
}
}
resp.Total, err = sess.Desc("user.id").FindAndCount(&m)
if err != nil {
return


Loading…
Cancel
Save