From c4108d587508507be35edc2a56b5142a7f0fc3e6 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Fri, 28 Oct 2022 22:42:54 +0800 Subject: [PATCH] opt input --- core/mall/goods.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/mall/goods.go b/core/mall/goods.go index 201efd3a..7cdff82d 100644 --- a/core/mall/goods.go +++ b/core/mall/goods.go @@ -15,16 +15,21 @@ const GOODS = "goods" func init() { Index.MergeCommands(ice.Commands{ - GOODS: {Name: "goods hash auto", Help: "商品", Actions: ice.MergeActions(ice.Actions{ - mdb.MODIFY: {Name: "modify zone type name text price count image"}, + GOODS: {Name: "goods hash@keyboard place@province date@date name@key auto", Help: "商品", Actions: ice.MergeActions(ice.Actions{ + mdb.MODIFY: {Name: "modify zone type name text price count image=4@img"}, + mdb.CREATE: {Name: "modify zone type name text price count image=4@img"}, web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) { web.Upload(m) }}, - "copy": {Hand: func(m *ice.Message, arg ...string) { m.Cmd("", mdb.CREATE, m.OptionSimple("zone,type,name,text,price,count,image")) }}, + "copy": {Hand: func(m *ice.Message, arg ...string) { + m.Cmd("", mdb.CREATE, m.OptionSimple("zone,type,name,text,price,count,image")) + }}, }, mdb.HashAction(mdb.FIELD, "time,hash,zone,type,name,text,price,count,image")), Hand: func(m *ice.Message, arg ...string) { if mdb.HashSelect(m, arg...); len(arg) == 0 || arg[0] == "" { m.Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT) ctx.DisplayLocal(m, "") } else { - m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+kit.Split(m.Append("image"))[0])) + for _, p := range kit.Split(m.Append("image")) { + m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+p)) + } } m.PushAction("copy", mdb.MODIFY, mdb.REMOVE) }},