mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 17:18:06 +08:00
35 lines
944 B
Go
35 lines
944 B
Go
package gongyinglian
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
kit "shylinux.com/x/toolkits"
|
|
|
|
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
|
)
|
|
|
|
type orderDetail struct {
|
|
Table
|
|
product Product
|
|
}
|
|
|
|
func (s orderDetail) Update(m *ice.Message, arg ...string) {
|
|
m.Option(model.PRICE, kit.Int(kit.Float(m.Option(model.PRICE))*100))
|
|
s.Table.Update(m, kit.Dict(m.OptionSimple(model.PRICE), model.COUNT, kit.Int(m.Option(model.COUNT))), arg...)
|
|
}
|
|
func (s orderDetail) List(m *ice.Message, arg ...string) {
|
|
if !s.checkOrderRole(m.Spawn(), arg...) {
|
|
return
|
|
}
|
|
s.Tables(m, s.product).FieldsWithCreatedAT(m, s,
|
|
model.NAME, model.INFO, s.Key(s, model.PRICE), s.Key(s, model.COUNT), model.UNIT,
|
|
model.PRODUCT_UID,
|
|
)
|
|
if len(arg) == 2 {
|
|
s.Select(m, model.ORDER_UID, arg[1])
|
|
} else if len(arg) == 3 {
|
|
s.SelectDetail(m, model.ORDER_UID, arg[1], model.UID, arg[2])
|
|
}
|
|
m.PushAction(s.Update, s.Remove)
|
|
}
|
|
func init() { ice.TeamCtxCmd(orderDetail{}) }
|