蜂鸟修改预下单
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user