This commit is contained in:
邹宗楠
2022-04-13 10:12:17 +08:00
parent 1ad33dee35
commit ef207a80ac
2 changed files with 16 additions and 18 deletions

View File

@@ -317,21 +317,19 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
var db = dao.GetDB()
//权限
if permission.IsRoled(ctx) {
// 查询用户门店
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
var storeIDs2 []int
var storeIDs []int
if err = utils.UnmarshalUseNumber([]byte(params["storeIDs"].(string)), &storeIDs); err != nil {
return nil, err
}
if params["storeIDs"] != nil {
for _, v := range storeIDs {
if storeIDsMap[v] != 0 {
storeIDs2 = append(storeIDs2, v)
var storeIDs []int
if err = utils.UnmarshalUseNumber([]byte(params["storeIDs"].(string)), &storeIDs); err == nil {
for _, v := range storeIDs {
if storeIDsMap[v] != 0 {
storeIDs2 = append(storeIDs2, v)
}
}
}
if len(storeIDs2) == 0 { // todo
storeIDs2 = append(storeIDs2, storeIDs...)
if len(storeIDs2) == 0 {
storeIDs2 = append(storeIDs2, -1)
}
} else {
if len(storeIDsMap) > 0 {
@@ -339,7 +337,7 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
storeIDs2 = append(storeIDs2, k)
}
} else {
storeIDs2 = append(storeIDs2, storeIDs...)
storeIDs2 = append(storeIDs2, -1)
}
}
if data, err := json.Marshal(storeIDs2); err == nil {
@@ -347,7 +345,7 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
}
}
}
//if isJxIncomeArea {
//if isJxIncomeArea {
// begin = utils.MustInterface2Int64(params["jxIncomeBegin"])
// end = utils.MustInterface2Int64(params["jxIncomeEnd"])
// pageSize = math.MaxInt32