|
@@ -52,10 +52,13 @@ func (m MediumListDb) UpdateMediumList(medium *model.MediumList, columns ...stri |
|
|
} |
|
|
} |
|
|
return affected, nil |
|
|
return affected, nil |
|
|
} |
|
|
} |
|
|
func (m MediumListDb) FindMediumList(uuid, name, state string, minState, page, limit int) (list []model.MediumList, total int64, err error) { |
|
|
|
|
|
|
|
|
func (m MediumListDb) FindMediumList(uuid, name, mediumId, state string, minState, page, limit int) (list []model.MediumList, total int64, err error) { |
|
|
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit) |
|
|
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit) |
|
|
|
|
|
if mediumId != "" { |
|
|
|
|
|
sess.In("medium_id", strings.Split(mediumId, ",")) |
|
|
|
|
|
} |
|
|
if name != "" { |
|
|
if name != "" { |
|
|
sess.In("medium_id", name) |
|
|
|
|
|
|
|
|
sess.And("company_name like ?", "%"+name+"%") |
|
|
} |
|
|
} |
|
|
if state != "" { |
|
|
if state != "" { |
|
|
sess.And("state = ?", state) |
|
|
sess.And("state = ?", state) |
|
|