mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 09:08:06 +08:00
opt some
This commit is contained in:
parent
bf77469cdc
commit
40f5859568
@ -10,14 +10,18 @@ import (
|
||||
type goods struct {
|
||||
Product
|
||||
create string `name:"create shop_uid*:select name* info price stock unit" role:"boss"`
|
||||
market string `name:"market domain_uid* title* content" role:"boss"`
|
||||
}
|
||||
|
||||
func (s goods) Create(m *ice.Message, arg ...string) {
|
||||
s.Product.Create(m, kit.Simple(model.PRODUCT_TYPE, ProductGoods, arg)...)
|
||||
}
|
||||
func (s goods) Market(m *ice.Message, arg ...string) {
|
||||
s.MarketInsert(m, arg...)
|
||||
}
|
||||
func (s goods) List(m *ice.Message, arg ...string) {
|
||||
s.Product.List(m.Options(model.PRODUCT_TYPE, kit.Format(ProductGoods)), arg...)
|
||||
kit.If(s.checkListRole(m, arg...), func() { m.PushAction(s.SetShop, s.SetBrand, s.SetQuality, s.Modify, s.Remove) })
|
||||
kit.If(s.checkListRole(m, arg...), func() { m.PushAction(s.Market, s.SetShop, s.SetBrand, s.SetQuality, s.Modify, s.Remove) })
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(goods{}) }
|
||||
|
@ -11,6 +11,7 @@ const (
|
||||
STATUS = "status"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
AUTH_UID = "auth_uid"
|
||||
USER_UID = "user_uid"
|
||||
USER_STORE_ROLE = "user_store_role"
|
||||
STORE_UID = "store_uid"
|
||||
|
@ -59,6 +59,7 @@ func (s Order) Purchase(m *ice.Message, arg ...string) {
|
||||
m.ProcessRewrite(model.UID, m.Result())
|
||||
}
|
||||
func (s Order) List(m *ice.Message, arg ...string) {
|
||||
m.Display("")
|
||||
if len(arg) == 1 {
|
||||
if !s.checkListRole(m, arg...) {
|
||||
return
|
||||
@ -190,15 +191,22 @@ func (s Order) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s Order) Amount(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(s.orderDetail, s.orderDetail.Amount, m.Option(model.UID))
|
||||
s.Table.Update(m, kit.Dict(msg.AppendSimple(model.AMOUNT, model.TOTAL)), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
func (s Order) Insert(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(s.product, m.Option(model.STORE_UID), m.Option(model.PRODUCT_UID))
|
||||
m.Cmd(s.orderDetail, s.Create, arg, msg.AppendSimple(model.PRICE), model.ORDER_UID, m.Option(model.UID))
|
||||
s.Amount(m)
|
||||
}
|
||||
func (s Order) Delete(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.orderDetail, s.Delete, model.UID, m.Option(model.ORDER_DETAIL_UID), model.ORDER_UID, m.Option(model.UID))
|
||||
s.Amount(m)
|
||||
}
|
||||
func (s Order) Update(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.orderDetail, s.Update, model.UID, m.Option(model.ORDER_DETAIL_UID), model.ORDER_UID, m.Option(model.UID))
|
||||
s.Amount(m)
|
||||
}
|
||||
func (s Order) Cancel(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, kit.Dict(model.STATUS, OrderCancel), m.OptionSimple(model.UID)...)
|
||||
@ -280,6 +288,7 @@ func (s Order) Payment(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(payment{}, s.Create, model.ORDER_UID, m.Option(model.UID), m.OptionSimple(model.COMPANY_UID, model.OPEN_ID), model.STATUS, PaymentSuccess)
|
||||
s.Table.Update(m, kit.Dict(model.PAYMENT_STATUS, PaymentSuccess, model.PAYMENT_SUCCESS_TIME, m.Time()), m.OptionSimple(model.UID)...)
|
||||
m.Option(model.FROM_USER_UID, msg.Option(model.FROM_USER_UID))
|
||||
Portal{}.DashboardUpdate(m)
|
||||
})
|
||||
s.sendTemplate(m, model.FROM_USER_UID, m.Trans("order payment", "订单已付款"))
|
||||
}
|
||||
@ -315,6 +324,7 @@ func (s Order) ConfirmExpress(m *ice.Message, arg ...string) {
|
||||
}
|
||||
s.Table.Update(m, kit.Dict(model.STATUS, OrderDeal, model.EXPRESS_STATUS, ExpressConfirm, model.EXPRESS_RECV_TIME, m.Time()), m.OptionSimple(model.UID)...)
|
||||
m.Option(model.FROM_USER_UID, msg.Option(model.FROM_USER_UID))
|
||||
Portal{}.DashboardUpdate(m)
|
||||
})
|
||||
s.sendTemplate(m, model.FROM_USER_UID, m.Trans("order confirm express", "订单已确认收货"))
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name||value.user_name||"待确认", can.onimport.textView(can, value, "order_type", mdb.TYPE)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), can.onimport.textView(can, value, "order_status", mdb.STATUS)]},
|
||||
{view: html.STATUS, list: ["数量:", value.total, "件", "总额:", value.amount, "元"]},
|
||||
value.payment_success_time && {view: html.STATUS, list: ["收款时间:", can.base.TimeTrim(value.payment_success_time)]},
|
||||
value.express_recv_time && {view: html.STATUS, list: ["收货时间:", can.base.TimeTrim(value.express_recv_time)]},
|
||||
value.return_recv_time && {view: html.STATUS, list: ["退货时间:", can.base.TimeTrim(value.return_recv_time)]},
|
||||
|
@ -16,10 +16,15 @@ 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) Amount(m *ice.Message, arg ...string) {
|
||||
s.Fields(m, "SUM(price * count) AS amount", "SUM(count) AS total")
|
||||
s.Select(m, model.ORDER_UID, arg[0])
|
||||
}
|
||||
func (s orderDetail) List(m *ice.Message, arg ...string) {
|
||||
if !s.checkOrderRole(m.Spawn(), arg...) {
|
||||
return
|
||||
}
|
||||
m.Display("")
|
||||
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_TYPE, model.PRODUCT_UID,
|
||||
|
@ -1,13 +1,27 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong"
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type Portal struct {
|
||||
guanlixitong.Portal
|
||||
product Product
|
||||
order Order
|
||||
placeCreate string `name:"placeCreate city_name* company_name* store_type*:select store_name*" role:"void"`
|
||||
}
|
||||
|
||||
func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) {
|
||||
s.DashboardCreate(m, "")
|
||||
s.DashboardInsert(m, "1", "订单总额", s.order, "SUM(amount) / 100.0", model.FROM_STORE_UID, m.Option(model.STORE_UID), model.STATUS, kit.Format(OrderDeal))
|
||||
s.DashboardInsert(m, "2", "订单数量", s.order, "", model.FROM_STORE_UID, m.Option(model.STORE_UID), model.STATUS, kit.Format(OrderDeal))
|
||||
s.DashboardInsert(m, "3", "库存数量", s.product, "SUM(stock)")
|
||||
s.DashboardInsert(m, "4", "库存总额", s.product, "SUM(stock * price) / 100.0")
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStore{}, store{})}) }
|
||||
|
@ -45,7 +45,7 @@ func (s Product) List(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(model.PRODUCT_TYPE), func(p string) { args = append(args, s.Key(s, model.TYPE), p) })
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, args...)
|
||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.EchoInfoButton("", s.Create) })
|
||||
s.Button(m, "")
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, append(args, s.Key(s, model.UID), arg[1])...)
|
||||
} else {
|
||||
|
@ -1,9 +1,6 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type Shop struct {
|
||||
Value
|
||||
@ -12,9 +9,6 @@ type Shop struct {
|
||||
modify string `name:"modify name* address" role:"boss"`
|
||||
}
|
||||
|
||||
func (s Shop) List(m *ice.Message, arg ...string) {
|
||||
s.Table.ValueList(m, arg)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("") })
|
||||
}
|
||||
func (s Shop) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) }
|
||||
|
||||
func init() { ice.TeamCtxCmd(Shop{}) }
|
||||
|
@ -21,6 +21,13 @@
|
||||
"time": "2024-08-05 00:34:49.421"
|
||||
}
|
||||
},
|
||||
"3971882ea4f32c86386ad04b39d3e3d4": {
|
||||
"meta": {
|
||||
"index": "web.team.gonganxitong.market",
|
||||
"order": "100",
|
||||
"time": "2024-09-07 08:52:22.362"
|
||||
}
|
||||
},
|
||||
"58724bdcc3cae3e26700cb3199e0602c": {
|
||||
"meta": {
|
||||
"index": "web.team.gonganxitong.placeUser",
|
||||
@ -79,12 +86,25 @@
|
||||
"time": "2024-08-20 21:48:51.239"
|
||||
}
|
||||
},
|
||||
"c1526ecd405021d6d47798c066bf70c0": {
|
||||
"meta": {
|
||||
"index": "web.team.gonganxitong.notice",
|
||||
"order": "70",
|
||||
"time": "2024-09-07 08:52:22.352"
|
||||
}
|
||||
},
|
||||
"c36d47e2611b0d1e7a14088bc3293d04": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.apply",
|
||||
"time": "2024-08-04 09:53:53.616"
|
||||
}
|
||||
},
|
||||
"d86e4e63183c8fae4ceb50498b0bcfde": {
|
||||
"meta": {
|
||||
"index": "web.team.gonganxitong.domain",
|
||||
"time": "2024-09-07 08:52:22.358"
|
||||
}
|
||||
},
|
||||
"e2117b53c036a72fe7e4885449488a6f": {
|
||||
"meta": {
|
||||
"index": "web.team.gonganxitong.qrcode",
|
||||
|
@ -80,6 +80,12 @@
|
||||
"time": "2024-08-20 21:24:23.289"
|
||||
}
|
||||
},
|
||||
"603552f8c3e96c6693d840810254f410": {
|
||||
"meta": {
|
||||
"index": "web.team.gongyinglian.domain",
|
||||
"time": "2024-09-07 08:52:22.315"
|
||||
}
|
||||
},
|
||||
"611c0a0505eb9d843ed02968e884bbf9": {
|
||||
"meta": {
|
||||
"index": "web.team.gongyinglian.goods",
|
||||
@ -111,6 +117,20 @@
|
||||
"time": "2024-08-20 21:24:23.298"
|
||||
}
|
||||
},
|
||||
"749051bc7a30b3e6a57563ce3f1565d9": {
|
||||
"meta": {
|
||||
"index": "web.team.gongyinglian.notice",
|
||||
"order": "94",
|
||||
"time": "2024-09-07 08:52:22.319"
|
||||
}
|
||||
},
|
||||
"7c9a204279f1cddfcecd1c7be74897aa": {
|
||||
"meta": {
|
||||
"index": "web.team.gongyinglian.market",
|
||||
"order": "100",
|
||||
"time": "2024-09-07 08:52:22.333"
|
||||
}
|
||||
},
|
||||
"8152d5a4a224ae3403fba2e01ea9ffef": {
|
||||
"meta": {
|
||||
"index": "web.team.gongyinglian.shop",
|
||||
|
@ -7,6 +7,12 @@
|
||||
"time": "2024-08-03 16:09:06.053"
|
||||
}
|
||||
},
|
||||
"04c6ed833d5cf77fef12937a0e58f2ba": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.domain",
|
||||
"time": "2024-09-07 08:52:22.301"
|
||||
}
|
||||
},
|
||||
"057616b7366e1930ef4e4a921fe45f1f": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.service",
|
||||
@ -29,6 +35,20 @@
|
||||
"time": "2024-08-12 08:57:09.639"
|
||||
}
|
||||
},
|
||||
"78d29149539be88d7561b8e17bd65882": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.market",
|
||||
"order": "100",
|
||||
"time": "2024-09-07 08:52:22.294"
|
||||
}
|
||||
},
|
||||
"809b63c1819fc3ac1452e3b71889aec5": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.notice",
|
||||
"order": "70",
|
||||
"time": "2024-09-07 08:52:22.295"
|
||||
}
|
||||
},
|
||||
"9c18032c5bc252f2986e1b20e7e77db7": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.event",
|
||||
|
@ -1,4 +1,17 @@
|
||||
{
|
||||
"095922877a62ea8c8191c4848f88e9e2": {
|
||||
"meta": {
|
||||
"index": "web.team.shichangyingxiao.domain",
|
||||
"time": "2024-09-07 08:52:22.280"
|
||||
}
|
||||
},
|
||||
"2c9df1f570f596584de4fa13c5b93e3c": {
|
||||
"meta": {
|
||||
"index": "web.team.shichangyingxiao.notice",
|
||||
"order": "70",
|
||||
"time": "2024-09-07 08:52:22.281"
|
||||
}
|
||||
},
|
||||
"46e6332c4605f69a33b1e77afa8946b1": {
|
||||
"meta": {
|
||||
"index": "web.team.shichangyingxiao.recent",
|
||||
@ -14,6 +27,13 @@
|
||||
"time": "2024-08-28 10:26:10.872"
|
||||
}
|
||||
},
|
||||
"87d12132d2a5af1a5f02d559b05f0079": {
|
||||
"meta": {
|
||||
"index": "web.team.shichangyingxiao.market",
|
||||
"order": "100",
|
||||
"time": "2024-09-07 08:52:22.289"
|
||||
}
|
||||
},
|
||||
"9411a77c619ee04f05c6786ee9012691": {
|
||||
"meta": {
|
||||
"index": "web.team.shichangyingxiao.promotion",
|
||||
|
@ -14,6 +14,13 @@
|
||||
"time": "2024-08-28 10:26:10.916"
|
||||
}
|
||||
},
|
||||
"1193f64afd8038b7424ca3ff61a20414": {
|
||||
"meta": {
|
||||
"index": "web.team.zijinlian.market",
|
||||
"order": "100",
|
||||
"time": "2024-09-07 08:52:22.273"
|
||||
}
|
||||
},
|
||||
"500957356f664f8f498fec0463c0059c": {
|
||||
"meta": {
|
||||
"index": "web.team.zijinlian.service",
|
||||
@ -21,6 +28,12 @@
|
||||
"time": "2024-08-28 10:26:10.913"
|
||||
}
|
||||
},
|
||||
"5a0fb6073ce525674d981e94da73be01": {
|
||||
"meta": {
|
||||
"index": "web.team.zijinlian.domain",
|
||||
"time": "2024-09-07 08:52:22.265"
|
||||
}
|
||||
},
|
||||
"76268373c0e2d37f0ecef7cda4e753bf": {
|
||||
"meta": {
|
||||
"index": "web.team.zijinlian.member",
|
||||
@ -51,6 +64,13 @@
|
||||
"time": "2024-08-28 10:26:10.911"
|
||||
}
|
||||
},
|
||||
"c1ce9668d8ab941e983d33c41b984e05": {
|
||||
"meta": {
|
||||
"index": "web.team.zijinlian.notice",
|
||||
"order": "70",
|
||||
"time": "2024-09-07 08:52:22.274"
|
||||
}
|
||||
},
|
||||
"ef38e71eba9d4bf20b1bad56fa2a0b18": {
|
||||
"meta": {
|
||||
"index": "web.team.zijinlian.qrcode",
|
||||
|
Loading…
x
Reference in New Issue
Block a user