|
@@ -210,14 +210,17 @@ func ListUser(condMap map[string]interface{}, page int, limit int) ([]map[string
|
|
whereSql := strings.Join(key, " and ")
|
|
whereSql := strings.Join(key, " and ")
|
|
var totalCount int64
|
|
var totalCount int64
|
|
var userInfo []map[string]interface{}
|
|
var userInfo []map[string]interface{}
|
|
- err := db.GetSFISDB().Table("user").Where(whereSql, param...).Count(&totalCount).Error
|
|
|
|
|
|
+ err := db.GetSFISDB().Table("user").Where(whereSql, param...).Where("delete_at is null").Count(&totalCount).Error
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, 0, errors.New("查询失败")
|
|
return nil, 0, errors.New("查询失败")
|
|
}
|
|
}
|
|
if totalCount == 0 {
|
|
if totalCount == 0 {
|
|
return userInfo, 0, nil
|
|
return userInfo, 0, nil
|
|
}
|
|
}
|
|
- sql := "select user.app_id,user.name,user.phone,user.secret_key,user.ip_white_list,user.create_at,money from user LEFT JOIN user_account on user.app_id=user_account.app_id where " + whereSql
|
|
|
|
|
|
+ if whereSql != ""{
|
|
|
|
+ whereSql = " and " + whereSql
|
|
|
|
+ }
|
|
|
|
+ sql := "select user.app_id,user.name,user.phone,user.secret_key,user.ip_white_list,user.create_at,money from user LEFT JOIN user_account on user.app_id=user_account.app_id where user.delete_at is Null " + whereSql
|
|
if limit != 0 && page > 0 {
|
|
if limit != 0 && page > 0 {
|
|
sql += fmt.Sprintf(" limit %d ,%d", (page-1)*limit, limit)
|
|
sql += fmt.Sprintf(" limit %d ,%d", (page-1)*limit, limit)
|
|
}
|
|
}
|