dengbiao 1 month ago
parent
commit
0200baa0a9
4 changed files with 15 additions and 5 deletions
  1. +1
    -0
      src/dao/egg_energy_basic_setting_dao.go
  2. +1
    -1
      src/dao/virtual_coin_dao.go
  3. +9
    -0
      src/implement/egg_energy_basic_setting_implement.go
  4. +4
    -4
      src/implement/virtual_coin_implement.go

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

@@ -8,4 +8,5 @@ import (
type EggEnergyBasicSettingDao interface {
EggEnergyBasicSettingUpdate(session *xorm.Session, id interface{}, EggEnergyBasicSetting *model.EggEnergyBasicSetting, forceColums ...string) (int64, error)
EggEnergyBasicSettingGetOneByParams(params map[string]interface{}) (*model.EggEnergyBasicSetting, error)
EggEnergyBasicSettingGetOne() (*model.EggEnergyBasicSetting, error)
}

+ 1
- 1
src/dao/virtual_coin_dao.go View File

@@ -4,5 +4,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type VirtualCoinDao interface {
//TODO:: You can add specific method definitions here
VirtualCoinFindAllAndCount(pageSize, page int) (kindList []model.VirtualCoin, total int64, err error)
VirtualCoinFindAll() ([]model.VirtualCoin, error)
}

+ 9
- 0
src/implement/egg_energy_basic_setting_implement.go View File

@@ -40,3 +40,12 @@ func (e EggEnergyBasicSettingDb) EggEnergyBasicSettingGetOneByParams(params map[
}
return &m, nil
}

func (e EggEnergyBasicSettingDb) EggEnergyBasicSettingGetOne() (*model.EggEnergyBasicSetting, error) {
var m *model.EggEnergyBasicSetting
_, err := e.Db.Where("id > ?", 1).Get(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err.Error())
}
return m, nil
}

+ 4
- 4
src/implement/virtual_coin_implement.go View File

@@ -15,11 +15,11 @@ type VirtualCoinDb struct {
Db *xorm.Engine
}

func (v VirtualCoinDb) VirtualCoinFindAllAndCount(pageSize, page int) (kindList []model.VirtualCoin, total int64, err error) {
func (v VirtualCoinDb) VirtualCoinFindAll() ([]model.VirtualCoin, error) {
var m []model.VirtualCoin
total, err = v.Db.Where("is_use = ?", 1).Asc("id").Limit(pageSize, (page-1)*pageSize).FindAndCount(&m)
err := v.Db.Where("").Find(&m)
if err != nil {
return nil, 0, zhios_order_relate_logx.Error(err)
return nil, zhios_order_relate_logx.Error(err.Error())
}
return m, total, nil
return m, nil
}

Loading…
Cancel
Save