浏览代码

update

add_mode
DengBiao 1年前
父节点
当前提交
214b8698ad
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. +5
    -6
      app/admin/svc/svc_user.go

+ 5
- 6
app/admin/svc/svc_user.go 查看文件

@@ -11,20 +11,19 @@ func UserList(req md.UserListReq) (resp md.UserListResp, err error) {
var m []model.User
userDb := db.UserDb{}
userDb.Set()
sess := userDb.Db.Join("LEFT", "user_identity", "user.id = user_identity.uid").
Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id").Limit(req.Limit, (req.Page-1)*req.Limit)
sess := userDb.Db.Limit(req.Limit, (req.Page-1)*req.Limit)
sess.Where("1=1")
if req.Phone != "" {
sess.And("user.phone like ?", "%"+req.Phone+"%")
sess.And("phone like ?", "%"+req.Phone+"%")
}
if req.Nickname != "" {
sess.And("user.nickname like ?", "%"+req.Nickname+"%")
sess.And("nickname like ?", "%"+req.Nickname+"%")
}
if req.CreateTimeStart != "" {
sess.And("user.create_at >= ?", req.CreateTimeStart)
sess.And("create_at >= ?", req.CreateTimeStart)
}
if req.CreateTimeEnd != "" {
sess.And("user.create_at <= ?", req.CreateTimeEnd)
sess.And("create_at <= ?", req.CreateTimeEnd)
}
resp.Total, err = sess.Desc("user.id").FindAndCount(&m)
if err != nil {


正在加载...
取消
保存