mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
feat: 数据查询完善-支持直接选择列输入值过滤数据
This commit is contained in:
@@ -29,6 +29,7 @@ func (m *Machine) Machines(rc *ctx.ReqCtx) {
|
||||
// 使用创建者id模拟账号成员id
|
||||
condition.CreatorId = rc.LoginAccount.Id
|
||||
condition.Ip = rc.GinCtx.Query("ip")
|
||||
condition.Name = rc.GinCtx.Query("name")
|
||||
condition.ProjectId = uint64(ginx.QueryInt(rc.GinCtx, "projectId", 0))
|
||||
|
||||
res := m.MachineApp.GetMachineList(condition, ginx.GetPageParam(rc.GinCtx), new([]*vo.MachineVO))
|
||||
|
||||
@@ -24,7 +24,10 @@ func (m *machineRepo) GetMachineList(condition *entity.Machine, pageParam *model
|
||||
if condition.Ip != "" {
|
||||
sql = sql + " AND m.ip LIKE '%" + condition.Ip + "%'"
|
||||
}
|
||||
sql = sql + " ORDER BY m.create_time DESC"
|
||||
if condition.Name != "" {
|
||||
sql = sql + " AND m.name LIKE '%" + condition.Name + "%'"
|
||||
}
|
||||
sql = sql + " ORDER BY m.project_id, m.create_time DESC"
|
||||
return model.GetPageBySql(sql, pageParam, toEntity)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user