@@ -11,4 +11,5 @@ type EggEnergyFundDataDao interface { | |||||
EggEnergyFundDataInsert(eggEnergyFundData *model.EggEnergyFundData) (int, error) | EggEnergyFundDataInsert(eggEnergyFundData *model.EggEnergyFundData) (int, error) | ||||
EggEnergyFundDataFindNotFinish() ([]model.EggEnergyFundData, error) | EggEnergyFundDataFindNotFinish() ([]model.EggEnergyFundData, error) | ||||
EggEnergyFundDataUpdateBySession(session *xorm.Session, m model.EggEnergyFundData, forceColumns ...string) (int64, error) | EggEnergyFundDataUpdateBySession(session *xorm.Session, m model.EggEnergyFundData, forceColumns ...string) (int64, error) | ||||
EggEnergyFundDataGetOneByParams(params map[string]interface{}) (*model.EggEnergyFundData, error) | |||||
} | } |
@@ -11,4 +11,5 @@ type PlatformRevenueDataDao interface { | |||||
PlatformRevenueDataFindAndCount(page, limit int, startAt, endAt string, kind int) ([]model.PlatformRevenueData, int64, error) | PlatformRevenueDataFindAndCount(page, limit int, startAt, endAt string, kind int) ([]model.PlatformRevenueData, int64, error) | ||||
PlatformRevenueDataFindNotFinish() ([]model.PlatformRevenueData, error) | PlatformRevenueDataFindNotFinish() ([]model.PlatformRevenueData, error) | ||||
PlatformRevenueDataUpdateBySession(session *xorm.Session, m model.PlatformRevenueData, forceColumns ...string) (int64, error) | PlatformRevenueDataUpdateBySession(session *xorm.Session, m model.PlatformRevenueData, forceColumns ...string) (int64, error) | ||||
PlatformRevenueDataGetOneByParams(params map[string]interface{}) (*model.PlatformRevenueData, error) | |||||
} | } |
@@ -4,6 +4,7 @@ import ( | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | ||||
"fmt" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -59,3 +60,12 @@ func (e EggEnergyFundDataDb) EggEnergyFundDataUpdateBySession(session *xorm.Sess | |||||
return affected, nil | return affected, nil | ||||
} | } | ||||
func (e EggEnergyFundDataDb) EggEnergyFundDataGetOneByParams(params map[string]interface{}) (*model.EggEnergyFundData, error) { | |||||
var m model.EggEnergyFundData | |||||
var query = fmt.Sprintf("%s =?", params["key"]) | |||||
if has, err := e.Db.Where(query, params["value"]).Get(&m); err != nil || has == false { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return &m, nil | |||||
} |
@@ -4,6 +4,7 @@ import ( | |||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" | ||||
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" | "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" | ||||
"fmt" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -59,3 +60,12 @@ func (p PlatformRevenueDataDb) PlatformRevenueDataUpdateBySession(session *xorm. | |||||
return affected, nil | return affected, nil | ||||
} | } | ||||
func (p PlatformRevenueDataDb) PlatformRevenueDataGetOneByParams(params map[string]interface{}) (*model.PlatformRevenueData, error) { | |||||
var m model.PlatformRevenueData | |||||
var query = fmt.Sprintf("%s =?", params["key"]) | |||||
if has, err := p.Db.Where(query, params["value"]).Get(&m); err != nil || has == false { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
return &m, nil | |||||
} |