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/bidding"
|
||||
"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"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -510,7 +511,6 @@ func (c *OrderController) StaleIndexInfo() {
|
||||
storeList []*dao.StoreWithCityName
|
||||
dataList = make([]int, 0, len(storeList))
|
||||
mapDataList = make(map[int]int, len(storeList))
|
||||
isAdmin = false
|
||||
vendors []int
|
||||
brandIds []int
|
||||
)
|
||||
@@ -529,18 +529,7 @@ func (c *OrderController) StaleIndexInfo() {
|
||||
return nil, "", fmt.Errorf("不能得到用户手机号,%s,%s", userID, mobile)
|
||||
}
|
||||
|
||||
userRoles, err := dao.GetUserRole(dao.GetDB(), []string{userID}, nil)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
for _, role := range userRoles {
|
||||
if role.RoleID == model.YES {
|
||||
isAdmin = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !isAdmin {
|
||||
if permission.IsRoled(ctx) {
|
||||
if storeList, err = cms.GetStoreList4User(ctx, mobile, userID); err == nil && len(storeList) > 0 {
|
||||
for _, v := range storeList {
|
||||
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 {
|
||||
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)
|
||||
return retVal, "", err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user