|
|
@@ -1,7 +1,9 @@ |
|
|
|
package implement |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
@@ -12,3 +14,22 @@ func NewEggEnergyFundDataDb(engine *xorm.Engine) dao.EggEnergyFundDataDao { |
|
|
|
type EggEnergyFundDataDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggEnergyFundDataDb) EggEnergyFundDataFindAndCount(page, limit, kind int, startAt, endAt string) ([]model.EggEnergyFundData, int64, error) { |
|
|
|
var m []model.EggEnergyFundData |
|
|
|
session := e.Db.Where("") |
|
|
|
if kind > 0 { |
|
|
|
session = session.Where("kind = ?", kind) |
|
|
|
} |
|
|
|
if startAt != "" { |
|
|
|
session = session.Where("start_at >= ?", startAt) |
|
|
|
} |
|
|
|
if endAt != "" { |
|
|
|
session = session.Where("end_at <= ?", endAt) |
|
|
|
} |
|
|
|
total, err := session.Limit(limit, (page-1)*limit).FindAndCount(&m) |
|
|
|
if err != nil { |
|
|
|
return nil, 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
} |
|
|
|
return m, total, nil |
|
|
|
} |