if columen != "" 模式
```go
func (m SshLogQ) Search(u *User) (list *[]SshLog, total uint, err error) {
list = &[]SshLog{}
tx := db.Model(m.SshLog).Preload("User").Preload("Machine")
if m.ClientIp != "" {
tx = tx.Where("client_ip like ?", "%"+m.ClientIp+"%")
}
if m.FromTime != "" && m.ToTime != "" {
tx = tx.Where("`created_at` BETWEEN ? AND ?", m.FromTime, m.ToTime)
}
if u.IsAdmin() {
if m.UserId > 0 {
tx = tx.Where("user_id = ?", m.UserId)
}
if m.MachineId > 0 {
tx = tx.Where("machine_id = ?", m.MachineId)
}
} else {
//非管理员 智能看自己的日志
//不支持搜索搜索
tx = tx.Where("`user_id` = ?",
u.Id)
}
total, err = crudAll(&m.PaginationQ, tx, list)
return
}
```