积分档位增加精灵配置
This commit is contained in:
@@ -52,6 +52,8 @@ func (l *GetStakeLevelListLogic) GetStakeLevelList(req *types.GetStakeLevelListR
|
||||
ls = append(ls, types.PointStakeLevel{
|
||||
Id: int(lv.Id),
|
||||
Title: lv.Title,
|
||||
ElfName: lv.ElfName,
|
||||
Rate: lv.Rate.InexactFloat64(),
|
||||
Level: int(lv.Level),
|
||||
Points: int(lv.Points),
|
||||
Days: lv.Days.InexactFloat64(),
|
||||
|
||||
@@ -48,6 +48,8 @@ type (
|
||||
Status int8 `db:"status"` // 状态,0=正常,1=停用
|
||||
CreatedAt time.Time `db:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `db:"updated_at"` // 修改时间
|
||||
ElfName string `db:"elf_name"` // 精灵名称
|
||||
Rate decimal.Decimal `db:"rate"` // 返利比率
|
||||
}
|
||||
)
|
||||
|
||||
@@ -79,14 +81,14 @@ func (m *defaultNhStakeHomePointConfigModel) FindOne(ctx context.Context, id uin
|
||||
}
|
||||
|
||||
func (m *defaultNhStakeHomePointConfigModel) Insert(ctx context.Context, data *NhStakeHomePointConfig) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?)", m.table, nhStakeHomePointConfigRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status)
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?)", m.table, nhStakeHomePointConfigRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status, data.ElfName, data.Rate)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultNhStakeHomePointConfigModel) Update(ctx context.Context, data *NhStakeHomePointConfig) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, nhStakeHomePointConfigRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status, data.Id)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status, data.ElfName, data.Rate, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -144,10 +144,12 @@ type PioneerReward struct {
|
||||
type PointStakeLevel struct {
|
||||
Id int `json:"id"` // 档位id
|
||||
Title string `json:"title"` // 档位标题
|
||||
ElfName string `json:"elf_name"` // 精灵名称
|
||||
Level int `json:"level"` // 精灵等级
|
||||
Points int `json:"points"` // 积分数量
|
||||
Days float64 `json:"days"` // 质押天数
|
||||
RenewDays float64 `json:"renew_days"` // 续期天数
|
||||
Rate float64 `json:"rate"` // 返利比率
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
|
||||
Reference in New Issue
Block a user