Browse Source

update

master
shenjiachi 1 week ago
parent
commit
593c843598
9 changed files with 21 additions and 10 deletions
  1. +1
    -0
      src/dao/egg_energy_price_dao.go
  2. +1
    -1
      src/implement/egg_energy_fund_data_implement.go
  3. +1
    -1
      src/implement/egg_energy_fund_data_records_implement.go
  4. +10
    -2
      src/implement/egg_energy_price_implement.go
  5. +2
    -2
      src/implement/new_user_red_package_implement.go
  6. +2
    -1
      src/implement/new_user_red_package_with_user_records_flow_implement.go
  7. +2
    -1
      src/implement/new_user_red_package_with_user_records_implement.go
  8. +1
    -1
      src/implement/platform_revenue_data_implement.go
  9. +1
    -1
      src/implement/platform_revenue_data_records_implement.go

+ 1
- 0
src/dao/egg_energy_price_dao.go View File

@@ -7,4 +7,5 @@ type EggEnergyPriceDao interface {
EggEnergyPriceList(startAt string, endAt string, hour string) ([]model.EggEnergyPrice, error)
EggEnergyPriceGetLastOne() (*model.EggEnergyPrice, bool, error)
EggEnergyPriceInsert(eggEnergyPrice *model.EggEnergyPrice) (int64, error)
EggEnergyPriceUpdate(eggEnergyPrice *model.EggEnergyPrice) (int64, error)
}

+ 1
- 1
src/implement/egg_energy_fund_data_implement.go View File

@@ -38,7 +38,7 @@ func (e EggEnergyFundDataDb) EggEnergyFundDataFindAndCount(page, limit, kind int
func (e EggEnergyFundDataDb) EggEnergyFundDataInsert(eggEnergyFundData *model.EggEnergyFundData) (int, error) {
_, err := e.Db.InsertOne(eggEnergyFundData)
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err.Error())
}
return eggEnergyFundData.Id, nil
}


+ 1
- 1
src/implement/egg_energy_fund_data_records_implement.go View File

@@ -39,7 +39,7 @@ func (e EggEnergyFundDataRecordsDb) EggEnergyFundDataRecordsGetLast(id int) (*mo
func (e EggEnergyFundDataRecordsDb) EggEnergyFundDataRecordsInsertBySession(session *xorm.Session, record model.EggEnergyFundDataRecords) (int, error) {
_, err := session.InsertOne(record)
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err.Error())
}
return record.Id, nil
}

+ 10
- 2
src/implement/egg_energy_price_implement.go View File

@@ -31,7 +31,7 @@ func (e EggEnergyPriceDb) EggEnergyPriceList(startAt string, endAt string, hour

func (e EggEnergyPriceDb) EggEnergyPriceGetLastOne() (*model.EggEnergyPrice, bool, error) {
var m model.EggEnergyPrice
exist, err := e.Db.OrderBy("date").OrderBy("hour").Get(&m)
exist, err := e.Db.Desc("id").Get(&m)
if err != nil {
return nil, false, zhios_order_relate_logx.Error(err.Error())
}
@@ -41,7 +41,15 @@ func (e EggEnergyPriceDb) EggEnergyPriceGetLastOne() (*model.EggEnergyPrice, boo
func (e EggEnergyPriceDb) EggEnergyPriceInsert(eggEnergyPrice *model.EggEnergyPrice) (int64, error) {
_, err := e.Db.InsertOne(eggEnergyPrice)
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err.Error())
}
return eggEnergyPrice.Id, nil
}

func (e EggEnergyPriceDb) EggEnergyPriceUpdate(eggEnergyPrice *model.EggEnergyPrice) (int64, error) {
affected, err := e.Db.ID(eggEnergyPrice.Id).Cols("price").Update(eggEnergyPrice)
if err != nil {
return 0, zhios_order_relate_logx.Error(err.Error())
}
return affected, nil
}

+ 2
- 2
src/implement/new_user_red_package_implement.go View File

@@ -26,7 +26,7 @@ func (n NewUserRedPackageDb) NewUserRedPackageGetOne() (*model.NewUserRedPackage
func (n NewUserRedPackageDb) NewUserRedPackageInsert(newUserRedPackage *model.NewUserRedPackage) (int, error) {
_, err := n.Db.InsertOne(newUserRedPackage)
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err)
}
return newUserRedPackage.Id, nil
}
@@ -42,7 +42,7 @@ func (n NewUserRedPackageDb) NewUserRedPackageUpdate(id interface{}, newUserRedP
affected, err = n.Db.Where("id=?", id).Update(newUserRedPackage)
}
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err)
}
return affected, nil
}

+ 2
- 1
src/implement/new_user_red_package_with_user_records_flow_implement.go View File

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

@@ -28,7 +29,7 @@ func (n NewUserRedPackageWithUserRecordsFlowDb) NewUserRedPackageWithUserRecords
}
total, err := session.Limit(limit, (page-1)*limit).Desc("create_at").FindAndCount(&m)
if err != nil {
return nil, 0, err
return nil, 0, zhios_order_relate_logx.Error(err)
}
return &m, total, nil
}

+ 2
- 1
src/implement/new_user_red_package_with_user_records_implement.go View File

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

@@ -28,7 +29,7 @@ func (n NewUserRedPackageWithUserRecordsDb) NewUserRedPackageWithUserRecordsFind
}
total, err := session.Limit(limit, (page-1)*limit).Desc("create_at").FindAndCount(&m)
if err != nil {
return nil, 0, err
return nil, 0, zhios_order_relate_logx.Error(err)
}
return &m, total, nil
}

+ 1
- 1
src/implement/platform_revenue_data_implement.go View File

@@ -19,7 +19,7 @@ type PlatformRevenueDataDb struct {
func (p PlatformRevenueDataDb) PlatformRevenueDataInsert(platformRevenueData *model.PlatformRevenueData) (int, error) {
_, err := p.Db.InsertOne(platformRevenueData)
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err.Error())
}
return platformRevenueData.Id, nil
}


+ 1
- 1
src/implement/platform_revenue_data_records_implement.go View File

@@ -30,7 +30,7 @@ func (p PlatformRevenueDataRecordsDb) PlatformRevenueDataRecordsGetLast(id int)
func (p PlatformRevenueDataRecordsDb) PlatformRevenueDataRecordsInsertBySession(session *xorm.Session, record model.PlatformRevenueDataRecords) (int, error) {
_, err := session.InsertOne(record)
if err != nil {
return 0, err
return 0, zhios_order_relate_logx.Error(err.Error())
}
return record.Id, nil
}

Loading…
Cancel
Save