|
|
@@ -0,0 +1,36 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/dao" |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/model" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewMediumFinancialDynamicsDb(engine *xorm.Engine) dao.MediumFinancialDynamicsDao { |
|
|
|
return &MediumFinancialDynamicsDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type MediumFinancialDynamicsDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (m MediumFinancialDynamicsDb) FindMediumFinancialDynamics(uuid, mediumId, startTime, endTime string, page, limit int) (list []model.MediumFinancialDynamics, total int64, err error) { |
|
|
|
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit) |
|
|
|
if uuid != "" { |
|
|
|
sess.And("uuid = ?", uuid) |
|
|
|
} |
|
|
|
if mediumId != "" { |
|
|
|
sess.And("medium_id = ?", mediumId) |
|
|
|
} |
|
|
|
if startTime != "" { |
|
|
|
sess.And("pay_time >= ?", startTime) |
|
|
|
} |
|
|
|
if endTime != "" { |
|
|
|
sess.And("pay_time <= ?", endTime) |
|
|
|
} |
|
|
|
total, err = sess.FindAndCount(&list) |
|
|
|
if err != nil { |
|
|
|
return nil, 0, err |
|
|
|
} |
|
|
|
return |
|
|
|
} |