Merge remote-tracking branch 'origin/lichang' into lite

This commit is contained in:
TsMask
2025-03-05 19:37:37 +08:00
parent 2c71040499
commit d9ef522f1c
26 changed files with 83 additions and 67 deletions

View File

@@ -26,10 +26,10 @@ func (r SysUser) SelectByPage(query map[string]string, dataScopeSQL string) ([]m
tx = tx.Where("user_id = ?", v)
}
if v, ok := query["userName"]; ok && v != "" {
tx = tx.Where("user_name like concat(?, '%')", v)
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", v))
}
if v, ok := query["phone"]; ok && v != "" {
tx = tx.Where("phone like concat(?, '%')", v)
tx = tx.Where("phone like ?", fmt.Sprintf("%s%%", v))
}
if v, ok := query["statusFlag"]; ok && v != "" {
tx = tx.Where("status_flag = ?", v)
@@ -85,10 +85,10 @@ func (r SysUser) Select(sysUser model.SysUser) []model.SysUser {
tx = tx.Where("del_flag = '0'")
// 查询条件拼接
if sysUser.UserName != "" {
tx = tx.Where("user_name like concat(?, '%')", sysUser.UserName)
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", sysUser.UserName))
}
if sysUser.Phone != "" {
tx = tx.Where("phone like concat(?, '%')", sysUser.Phone)
tx = tx.Where("phone like ?", fmt.Sprintf("%s%%", sysUser.Phone))
}
if sysUser.StatusFlag != "" {
tx = tx.Where("status_flag = ?", sysUser.StatusFlag)
@@ -229,10 +229,10 @@ func (r SysUser) SelectAuthUsersByPage(query map[string]string, dataScopeSQL str
tx = tx.Where("del_flag = '0'")
// 查询条件拼接
if v, ok := query["userName"]; ok && v != "" {
tx = tx.Where("user_name like concat(?, '%')", v)
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", v))
}
if v, ok := query["phone"]; ok && v != "" {
tx = tx.Where("phone like concat(?, '%')", v)
tx = tx.Where("phone like ?", fmt.Sprintf("%s%%", v))
}
if v, ok := query["statusFlag"]; ok && v != "" {
tx = tx.Where("status_flag = ?", v)