浏览代码

add 基础设置

tags/v0.0.2
shenjiachi 1周前
父节点
当前提交
b7ed2908de
共有 4 个文件被更改,包括 15 次插入5 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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
}

正在加载...
取消
保存