From b07cc39afdf93ed8b40b7fddfa2acda5a31199a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 30 Mar 2022 13:39:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=9C=82=E9=B8=9F=E4=BF=AE=E6=94=B9=E9=A2=84?= =?UTF-8?q?=E4=B8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 12 +++++------- business/jxstore/permission/permission.go | 1 - business/partner/delivery/fn/waybill.go | 3 +++ controllers/cms_store_sku.go | 4 ---- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 9143dd0cd..83ed93bed 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -478,6 +478,7 @@ func GetStoreSkus(ctx *jxcontext.Context, storeID int, skuIDs []int, isFocus boo } func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []string, isFocus bool, keyword string, isBySku, isAct, isHighPrice bool, priceType int, actVendorID int, params map[string]interface{}) (sql string, sqlParams []interface{}, err error) { + // 查看指定商店,对应的商品数据和商品价格等参数说明 sql = ` FROM sku_name t1 JOIN sku t2 FORCE INDEX(PRIMARY) ON t1.id = t2.name_id AND t2.deleted_at = ?/* AND t2.status = ?*/ @@ -495,7 +496,7 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin model.ThingTypeSku, utils.DefaultTimeValue, } if isFocus { - if isAct { + if isAct { // 查看活动 sql += ` JOIN ( SELECT t2.store_id, t2.sku_id, @@ -735,12 +736,10 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin } func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) { - fmt.Println("用户入参storeIDs", storeIDs) - //权限 管理员/未登录人员不进入,商城不进入 - fmt.Println("用户权限", permission.IsRoled(ctx)) + // 管理员进入 if permission.IsRoled(ctx) { + // 获取管理员绑定门店 if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil { - fmt.Println("用户权限门店", storeIDsMap) var storeIDs2 []int if len(storeIDs) > 0 { for _, v := range storeIDs { @@ -749,7 +748,7 @@ func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string } } if len(storeIDs2) == 0 { - storeIDs2 = append(storeIDs2, storeIDs...) + storeIDs2 = append(storeIDs2, -1) } } else { for k, _ := range storeIDsMap { @@ -760,7 +759,6 @@ func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string storeIDs = storeIDs2 } } - fmt.Println("用户出参storeIDs", storeIDs) return GetStoresSkusNew(ctx, storeIDs, skuIDs, upcs, isFocus, isHighPrice, priceType, keyword, isBySku, isAct, params, offset, pageSize) } diff --git a/business/jxstore/permission/permission.go b/business/jxstore/permission/permission.go index a552a8364..f59d5f042 100644 --- a/business/jxstore/permission/permission.go +++ b/business/jxstore/permission/permission.go @@ -419,7 +419,6 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) { func IsRoled(ctx *jxcontext.Context) bool { if ctx.GetUserName() != "jxadmin" { if user, err := dao.GetUserByID(dao.GetDB(), "user_id", ctx.GetUserID()); err == nil { - fmt.Println("用户type", user.Type) if user.Type&model.UserTypeRole != 0 { return true } diff --git a/business/partner/delivery/fn/waybill.go b/business/partner/delivery/fn/waybill.go index a29cb8839..a949dd6a9 100644 --- a/business/partner/delivery/fn/waybill.go +++ b/business/partner/delivery/fn/waybill.go @@ -197,7 +197,10 @@ func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInf }) } preCreateOrder.GoodsItemList = goodsList + + deliveryFeeInfo = &partner.WaybillFeeInfo{} deliveryFeeInfo.RefDeliveryFee, deliveryFeeInfo.RefAddFee, err = api.FnAPI.PreCreateByShopFn(preCreateOrder) + deliveryFeeInfo.DeliveryFee = deliveryFeeInfo.RefDeliveryFee return deliveryFeeInfo, err } diff --git a/controllers/cms_store_sku.go b/controllers/cms_store_sku.go index b7501bf7b..7be612dd4 100644 --- a/controllers/cms_store_sku.go +++ b/controllers/cms_store_sku.go @@ -1,7 +1,6 @@ package controllers import ( - "fmt" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/baseapi/platformapi/jdapi" @@ -100,11 +99,8 @@ func (c *StoreSkuController) GetStoresSkus() { var storeIDs, skuIDs []int var upcs []string if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.SkuIDs, &skuIDs, params.Upcs, &upcs); err == nil { - fmt.Println("params.StoreIDs:=", params.StoreIDs) - fmt.Println("storeIDs:=", storeIDs) retVal, err = cms.GetStoresSkus(params.Ctx, storeIDs, skuIDs, upcs, params.IsFocus, params.IsHighPrice, params.PriceType, params.Keyword, params.IsBySku, params.IsAct, params.MapData, params.Offset, params.PageSize) } - fmt.Println("==================", retVal) return retVal, "", err }) }