fix(plugin): fix rank config about question show/hide

This commit is contained in:
LinkinStars 2023-04-25 15:34:35 +08:00
parent df9b08abcf
commit e377daaac9
2 changed files with 16 additions and 8 deletions

View File

@ -366,10 +366,14 @@ func initConfigTable(engine *xorm.Engine) error {
{ID: 116, Key: "rank.question.reopen", Value: `-1`},
{ID: 117, Key: "rank.tag.use_reserved_tag", Value: `-1`},
{ID: 118, Key: "plugin.status", Value: `{}`},
{ID: 119, Key: "rank.question.pin", Value: `-1`},
{ID: 120, Key: "rank.question.unpin", Value: `-1`},
{ID: 121, Key: "rank.question.show", Value: `-1`},
{ID: 122, Key: "rank.question.hide", Value: `-1`},
{ID: 119, Key: "question.pin", Value: `0`},
{ID: 120, Key: "question.unpin", Value: `0`},
{ID: 121, Key: "question.show", Value: `0`},
{ID: 122, Key: "question.hide", Value: `0`},
{ID: 123, Key: "rank.question.pin", Value: `-1`},
{ID: 124, Key: "rank.question.unpin", Value: `-1`},
{ID: 125, Key: "rank.question.show", Value: `-1`},
{ID: 126, Key: "rank.question.hide", Value: `-1`},
}
_, err := engine.Insert(defaultConfigTable)
return err

View File

@ -63,10 +63,14 @@ func addRolePinAndHideFeatures(x *xorm.Engine) error {
}
defaultConfigTable := []*entity.Config{
{ID: 119, Key: "rank.question.pin", Value: `-1`},
{ID: 120, Key: "rank.question.unpin", Value: `-1`},
{ID: 121, Key: "rank.question.show", Value: `-1`},
{ID: 122, Key: "rank.question.hide", Value: `-1`},
{ID: 119, Key: "question.pin", Value: `0`},
{ID: 120, Key: "question.unpin", Value: `0`},
{ID: 121, Key: "question.show", Value: `0`},
{ID: 122, Key: "question.hide", Value: `0`},
{ID: 123, Key: "rank.question.pin", Value: `-1`},
{ID: 124, Key: "rank.question.unpin", Value: `-1`},
{ID: 125, Key: "rank.question.show", Value: `-1`},
{ID: 126, Key: "rank.question.hide", Value: `-1`},
}
for _, c := range defaultConfigTable {
exist, err := x.Get(&entity.Config{ID: c.ID})