1
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/bidding"
|
"git.rosy.net.cn/jx-callback/business/bidding"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxstore/permission"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -510,7 +511,6 @@ func (c *OrderController) StaleIndexInfo() {
|
|||||||
storeList []*dao.StoreWithCityName
|
storeList []*dao.StoreWithCityName
|
||||||
dataList = make([]int, 0, len(storeList))
|
dataList = make([]int, 0, len(storeList))
|
||||||
mapDataList = make(map[int]int, len(storeList))
|
mapDataList = make(map[int]int, len(storeList))
|
||||||
isAdmin = false
|
|
||||||
vendors []int
|
vendors []int
|
||||||
brandIds []int
|
brandIds []int
|
||||||
)
|
)
|
||||||
@@ -529,18 +529,7 @@ func (c *OrderController) StaleIndexInfo() {
|
|||||||
return nil, "", fmt.Errorf("不能得到用户手机号,%s,%s", userID, mobile)
|
return nil, "", fmt.Errorf("不能得到用户手机号,%s,%s", userID, mobile)
|
||||||
}
|
}
|
||||||
|
|
||||||
userRoles, err := dao.GetUserRole(dao.GetDB(), []string{userID}, nil)
|
if permission.IsRoled(ctx) {
|
||||||
if err != nil {
|
|
||||||
return nil, "", err
|
|
||||||
}
|
|
||||||
for _, role := range userRoles {
|
|
||||||
if role.RoleID == model.YES {
|
|
||||||
isAdmin = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !isAdmin {
|
|
||||||
if storeList, err = cms.GetStoreList4User(ctx, mobile, userID); err == nil && len(storeList) > 0 {
|
if storeList, err = cms.GetStoreList4User(ctx, mobile, userID); err == nil && len(storeList) > 0 {
|
||||||
for _, v := range storeList {
|
for _, v := range storeList {
|
||||||
dataList = append(dataList, v.Store.ID)
|
dataList = append(dataList, v.Store.ID)
|
||||||
@@ -555,6 +544,11 @@ func (c *OrderController) StaleIndexInfo() {
|
|||||||
if err := jxutils.Strings2Objs(params.VendorIds, &vendors, params.BrandIds, &brandIds); err != nil {
|
if err := jxutils.Strings2Objs(params.VendorIds, &vendors, params.BrandIds, &brandIds); err != nil {
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if permission.IsRoled(ctx) && len(dataList) == model.NO {
|
||||||
|
return retVal, "", fmt.Errorf("于该用户%s,暂无门店信息", ctx.GetUserName())
|
||||||
|
}
|
||||||
|
|
||||||
retVal, err = orderman.FixedOrderManager.GetStoresOrderSaleInfo2(params.Ctx, timeList[0], timeList[1], params.StoreID, brandIds, vendors, dataList)
|
retVal, err = orderman.FixedOrderManager.GetStoresOrderSaleInfo2(params.Ctx, timeList[0], timeList[1], params.StoreID, brandIds, vendors, dataList)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user