1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-05 12:47:03 +08:00
This commit is contained in:
shaoying 2021-02-19 23:37:43 +08:00
parent 9a3a005c32
commit 486eca1144
2 changed files with 8 additions and 2 deletions

View File

@ -51,6 +51,10 @@ func init() {
aaa.USERROLE: {Name: "userrole", Help: "用户角色", Hand: func(m *ice.Message, arg ...string) {
m.Echo(aaa.UserRole(m, m.Option("who")))
}},
aaa.USERNICK: {Name: "usernick", Help: "用户昵称", Hand: func(m *ice.Message, arg ...string) {
m.Option(aaa.USERNAME, m.Option(ice.MSG_USERNAME))
m.Cmdy("aaa.user", kit.MDB_ACTION, mdb.MODIFY, aaa.USERNICK, arg[0])
}},
BACKGROUND: {Name: "background", Help: "背景图片", Hand: func(m *ice.Message, arg ...string) {
m.Option(BACKGROUND, m.Conf(HEADER, BACKGROUND, arg[0]))
}},

View File

@ -25,9 +25,11 @@ func init() {
if _task_list(m, kit.Select("", arg, 0), kit.Select("", arg, 1)); len(arg) == 0 {
return
} else if len(arg) == 1 {
m.SortTime(TaskField.BEGIN_TIME)
}
m.SortTime(TaskField.BEGIN_TIME)
tz := int64(8)
m.Table(func(index int, value map[string]string, head []string) {
if value[kit.MDB_STATUS] == TaskStatus.CANCEL {
return
@ -38,7 +40,7 @@ func init() {
show = append(show, kit.Format(`<div class="%v">%v</div>`, k, value[k]))
}
t := kit.Time(value[TaskField.BEGIN_TIME])/int64(time.Second)/3600/24 - time.Now().Unix()/3600/24
t := (kit.Time(value[TaskField.BEGIN_TIME])+int64(time.Hour)*tz)/int64(time.Second)/3600/24 - (time.Now().Unix()+3600*tz)/3600/24
m.Echo(`<div class="item %s" title="%s">距离 %v%v%v<span class="day"> %v </span>天</div>`,
kit.Select("gone", "come", t > 0), value[kit.MDB_TEXT],
strings.Split(value[TaskField.BEGIN_TIME], " ")[0],