From dd3d8b847a2a9435739b8d1ceee017bd5cc1217d Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 19 Nov 2024 15:57:36 +0800 Subject: [PATCH] 1 --- app/svc/svc_cate.go | 3 ++- app/svc/svc_goods.go | 3 ++- app/svc/svc_order.go | 3 ++- app/svc/svc_pay_community_team.go | 2 +- app/svc/svc_pay_community_team_pay.go | 2 +- app/svc/svc_store.go | 18 ++++++++++++++++-- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/app/svc/svc_cate.go b/app/svc/svc_cate.go index d78580f..db798d7 100644 --- a/app/svc/svc_cate.go +++ b/app/svc/svc_cate.go @@ -8,7 +8,8 @@ import ( ) func Cate(c *gin.Context) { - storeId := c.GetHeader("store_id") + storeId := GetStoreId(c) + if storeId == "" { storeId = "0" } diff --git a/app/svc/svc_goods.go b/app/svc/svc_goods.go index 0a750c5..cbcc58c 100644 --- a/app/svc/svc_goods.go +++ b/app/svc/svc_goods.go @@ -14,7 +14,8 @@ func Goods(c *gin.Context) { e.OutErr(c, e.ERR_INVALID_ARGS, err) return } - storeId := c.GetHeader("store_id") + storeId := GetStoreId(c) + arg["store_type"] = "0" if utils.StrToInt(storeId) > 0 { arg["uid"] = storeId diff --git a/app/svc/svc_order.go b/app/svc/svc_order.go index a7c089b..27484a3 100644 --- a/app/svc/svc_order.go +++ b/app/svc/svc_order.go @@ -235,7 +235,8 @@ func OrderCoupon(c *gin.Context) { } func CommCoupon(c *gin.Context, totalPrice string) map[string]interface{} { couponList := make([]md.CouponList, 0) - storeId := c.GetHeader("store_id") + storeId := GetStoreId(c) + if utils.StrToInt(storeId) > 0 { storeData := db.GetStoreIdEg(MasterDb(c), storeId) if storeData != nil && storeData.StoreType > 0 { diff --git a/app/svc/svc_pay_community_team.go b/app/svc/svc_pay_community_team.go index 42fe4b9..26c8253 100644 --- a/app/svc/svc_pay_community_team.go +++ b/app/svc/svc_pay_community_team.go @@ -59,7 +59,7 @@ func WxPayCommunityTeam(c *gin.Context) (interface{}, error) { params := map[string]string{ "subject": "小店下单", "amount": wxMoneyMulHundred(ord.Amount), - "order_type": md.AggregationRecharge, + "order_type": md.CommunityTeam, "ord_id": utils.AnyToString(ord.Oid), "pay_wx_mch_id": SysCfgGet(c, "pay_wx_mch_id"), "pay_wx_api_key": SysCfgGet(c, "pay_wx_api_key"), diff --git a/app/svc/svc_pay_community_team_pay.go b/app/svc/svc_pay_community_team_pay.go index 34316fa..4003cf4 100644 --- a/app/svc/svc_pay_community_team_pay.go +++ b/app/svc/svc_pay_community_team_pay.go @@ -56,7 +56,7 @@ func WxPayCommunityTeamPay(c *gin.Context) (interface{}, error) { params := map[string]string{ "subject": "收款码收款", "amount": wxMoneyMulHundred(ord.Amount), - "order_type": md.AggregationRecharge, + "order_type": md.CommunityTeamPay, "ord_id": utils.AnyToString(ord.Oid), "pay_wx_mch_id": SysCfgGet(c, "pay_wx_mch_id"), "pay_wx_api_key": SysCfgGet(c, "pay_wx_api_key"), diff --git a/app/svc/svc_store.go b/app/svc/svc_store.go index 52f972d..0fb30be 100644 --- a/app/svc/svc_store.go +++ b/app/svc/svc_store.go @@ -388,7 +388,8 @@ func StoreLike(c *gin.Context) { return } arg["store_type"] = "0" - storeId := c.GetHeader("store_id") + storeId := GetStoreId(c) + if utils.StrToInt(storeId) > 0 { arg["store_id"] = storeId storeData := db.GetStoreIdEg(MasterDb(c), storeId) @@ -438,6 +439,19 @@ func StoreLike(c *gin.Context) { e.OutSuc(c, storeList, nil) return } +func GetStoreId(c *gin.Context) string { + storeId := c.GetHeader("store_id") + if utils.StrToInt(storeId) == 0 { + storeId = c.GetHeader("storeId") + } + if utils.StrToInt(storeId) == 0 { + storeId = c.GetHeader("storeid") + } + if utils.StrToInt(storeId) == 0 { + storeId = c.GetHeader("StoreId") + } + return storeId +} func Store(c *gin.Context) { var arg map[string]string if err := c.ShouldBindJSON(&arg); err != nil { @@ -445,7 +459,7 @@ func Store(c *gin.Context) { return } arg["store_type"] = "0" - storeId := c.GetHeader("store_id") + storeId := GetStoreId(c) if utils.StrToInt(storeId) > 0 { arg["store_id"] = storeId storeData := db.GetStoreIdEg(MasterDb(c), storeId)