shenjiachi 1 тиждень тому
джерело
коміт
b87b1b4e41
4 змінених файлів з 22 додано та 0 видалено
  1. +1
    -0
      src/dao/egg_energy_fund_data_dao.go
  2. +1
    -0
      src/dao/platform_revenue_data_dao.go
  3. +10
    -0
      src/implement/egg_energy_fund_data_implement.go
  4. +10
    -0
      src/implement/platform_revenue_data_implement.go

+ 1
- 0
src/dao/egg_energy_fund_data_dao.go Переглянути файл

@@ -11,4 +11,5 @@ type EggEnergyFundDataDao interface {
EggEnergyFundDataInsert(eggEnergyFundData *model.EggEnergyFundData) (int, error)
EggEnergyFundDataFindNotFinish() ([]model.EggEnergyFundData, error)
EggEnergyFundDataUpdateBySession(session *xorm.Session, m model.EggEnergyFundData, forceColumns ...string) (int64, error)
EggEnergyFundDataGetOneByParams(params map[string]interface{}) (*model.EggEnergyFundData, error)
}

+ 1
- 0
src/dao/platform_revenue_data_dao.go Переглянути файл

@@ -11,4 +11,5 @@ type PlatformRevenueDataDao interface {
PlatformRevenueDataFindAndCount(page, limit int, startAt, endAt string, kind int) ([]model.PlatformRevenueData, int64, error)
PlatformRevenueDataFindNotFinish() ([]model.PlatformRevenueData, error)
PlatformRevenueDataUpdateBySession(session *xorm.Session, m model.PlatformRevenueData, forceColumns ...string) (int64, error)
PlatformRevenueDataGetOneByParams(params map[string]interface{}) (*model.PlatformRevenueData, error)
}

+ 10
- 0
src/implement/egg_energy_fund_data_implement.go Переглянути файл

@@ -4,6 +4,7 @@ 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"
"fmt"
"xorm.io/xorm"
)

@@ -59,3 +60,12 @@ func (e EggEnergyFundDataDb) EggEnergyFundDataUpdateBySession(session *xorm.Sess

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
}

+ 10
- 0
src/implement/platform_revenue_data_implement.go Переглянути файл

@@ -4,6 +4,7 @@ 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"
"fmt"
"xorm.io/xorm"
)

@@ -59,3 +60,12 @@ func (p PlatformRevenueDataDb) PlatformRevenueDataUpdateBySession(session *xorm.

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
}

Завантаження…
Відмінити
Зберегти