mirror of
https://shylinux.com/x/operation
synced 2025-07-01 13:14:43 +08:00
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package production
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
"shylinux.com/x/operation/src/production/model"
|
|
kit "shylinux.com/x/toolkits"
|
|
)
|
|
|
|
type deal struct {
|
|
Table
|
|
order string `data:"7"`
|
|
fields string `data:"from_user_uid,to_user_uid,price,title,content"`
|
|
create string `name:"create issue_uid* from_user_uid* to_user_uid* price* title* content" role:"leader"`
|
|
}
|
|
|
|
func (s deal) Create(m *ice.Message, arg ...string) {
|
|
s.Table.Create(m, arg...)
|
|
s.SendMessage(s.GetCommandUID(m), "", m.Option(model.TO_USER_UID))
|
|
}
|
|
func (s deal) List(m *ice.Message, arg ...string) {
|
|
if s.IsLeader(m) {
|
|
s.ValueList(m, arg).PushAction()
|
|
s.StatusPrice(m, arg...)
|
|
} else {
|
|
if len(arg) == 1 {
|
|
s.Select(m, model.STORY_UID, arg[0], model.TO_USER_UID, m.Option(model.USER_UID)).PushAction().Action()
|
|
kit.If(m.Length() == 0, func() { m.Echo("请等待管理员支付工钱") })
|
|
} else {
|
|
s.SelectDetail(m, model.STORY_UID, arg[0], model.TO_USER_UID, m.Option(model.USER_UID), model.UID, arg[1]).PushAction().Action()
|
|
s.DoneMessage(m)
|
|
}
|
|
}
|
|
if s.IsLeader(m) {
|
|
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
|
|
} else {
|
|
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
|
|
}
|
|
// s.SelectJoinUser(m).
|
|
m.Display("")
|
|
}
|
|
|
|
func init() { ice.TeamCtxCmd(deal{}) }
|