@@ -8,4 +8,5 @@ import ( | |||||
type EggEnergyBasicSettingDao interface { | type EggEnergyBasicSettingDao interface { | ||||
EggEnergyBasicSettingUpdate(session *xorm.Session, id interface{}, EggEnergyBasicSetting *model.EggEnergyBasicSetting, forceColums ...string) (int64, error) | EggEnergyBasicSettingUpdate(session *xorm.Session, id interface{}, EggEnergyBasicSetting *model.EggEnergyBasicSetting, forceColums ...string) (int64, error) | ||||
EggEnergyBasicSettingGetOneByParams(params map[string]interface{}) (*model.EggEnergyBasicSetting, error) | EggEnergyBasicSettingGetOneByParams(params map[string]interface{}) (*model.EggEnergyBasicSetting, error) | ||||
EggEnergyBasicSettingGetOne() (*model.EggEnergyBasicSetting, error) | |||||
} | } |
@@ -4,5 +4,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | |||||
type VirtualCoinDao interface { | type VirtualCoinDao interface { | ||||
//TODO:: You can add specific method definitions here | //TODO:: You can add specific method definitions here | ||||
VirtualCoinFindAllAndCount(pageSize, page int) (kindList []model.VirtualCoin, total int64, err error) | |||||
VirtualCoinFindAll() ([]model.VirtualCoin, error) | |||||
} | } |
@@ -40,3 +40,12 @@ func (e EggEnergyBasicSettingDb) EggEnergyBasicSettingGetOneByParams(params map[ | |||||
} | } | ||||
return &m, nil | 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 | |||||
} |
@@ -15,11 +15,11 @@ type VirtualCoinDb struct { | |||||
Db *xorm.Engine | 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 | 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 { | 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 | |||||
} | } |