aa
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/permission"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -398,9 +399,29 @@ type GetStoreManageStateResult struct {
|
||||
RepurchaseRate int `json:"repurchaseRate"` //复购率(转化率)
|
||||
}
|
||||
|
||||
func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, fromTime, toTime string) (getStoreManageStateResult *GetStoreManageStateResult, err error) {
|
||||
return &GetStoreManageStateResult{
|
||||
func GetStoreManageState(ctx *jxcontext.Context, storeIDs []int, vendorID int, fromTime, toTime string) (getStoreManageStateResult []*GetStoreManageStateResult, err error) {
|
||||
//权限
|
||||
if permission.IsRoled(ctx) {
|
||||
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
||||
var storeIDs2 []int
|
||||
if len(storeIDs) > 0 {
|
||||
for _, v := range storeIDs {
|
||||
if storeIDsMap[v] != 0 {
|
||||
storeIDs2 = append(storeIDs2, v)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for k, _ := range storeIDsMap {
|
||||
storeIDs2 = append(storeIDs2, k)
|
||||
}
|
||||
}
|
||||
storeIDs = nil
|
||||
storeIDs = storeIDs2
|
||||
}
|
||||
}
|
||||
getStoreManageStateResult = append(getStoreManageStateResult, &GetStoreManageStateResult{
|
||||
StoreID: 1,
|
||||
StoreName: "1",
|
||||
}, err
|
||||
})
|
||||
return getStoreManageStateResult, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user