|
|
@@ -1,4 +1,4 @@ |
|
|
|
package implement |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/dao" |
|
|
@@ -42,3 +42,17 @@ func (m MediumListDb) UpdateMediumList(medium *model.MediumList, columns ...stri |
|
|
|
} |
|
|
|
return affected, nil |
|
|
|
} |
|
|
|
func (m MediumListDb) FindMediumList(name, state string, page, limit int) (list []model.MediumList, total int64, err error) { |
|
|
|
sess := m.Db.Where("state>0").Desc("id").Limit(limit, (page-1)*limit) |
|
|
|
if name != "" { |
|
|
|
sess.And("company_name like ?", "%"+name+"%") |
|
|
|
} |
|
|
|
if state != "" { |
|
|
|
sess.And("state = ?", state) |
|
|
|
} |
|
|
|
total, err = sess.FindAndCount(&list) |
|
|
|
if err != nil { |
|
|
|
return nil, 0, err |
|
|
|
} |
|
|
|
return |
|
|
|
} |