1
This commit is contained in:
@@ -2,7 +2,6 @@ package dao
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
@@ -2076,8 +2075,6 @@ func StaticStoreOrderChange(db *DaoDB, storeId []int, start, end time.Time, rank
|
|||||||
|
|
||||||
lastSql = fmt.Sprintf(lastSql, rank)
|
lastSql = fmt.Sprintf(lastSql, rank)
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("-----sql := %s", lastSql)
|
|
||||||
globals.SugarLogger.Debugf("-----dailyParam := %s", utils.Format4Output(dailyParam, false))
|
|
||||||
data := make([]*StoreOrderRank, 0, 0)
|
data := make([]*StoreOrderRank, 0, 0)
|
||||||
if err := GetRows(db, &data, lastSql, dailyParam...); err != nil {
|
if err := GetRows(db, &data, lastSql, dailyParam...); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -579,9 +579,9 @@ func (c *OrderController) StaleIndexInfo() {
|
|||||||
func (c *OrderController) StoreOrderRank() {
|
func (c *OrderController) StoreOrderRank() {
|
||||||
c.callStoreOrderRank(func(params *tOrderStoreOrderRankParams) (retVal interface{}, code string, err error) {
|
c.callStoreOrderRank(func(params *tOrderStoreOrderRankParams) (retVal interface{}, code string, err error) {
|
||||||
var (
|
var (
|
||||||
//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))
|
||||||
)
|
)
|
||||||
timeList, err := jxutils.BatchStr2Time(params.Start, params.End)
|
timeList, err := jxutils.BatchStr2Time(params.Start, params.End)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -592,33 +592,33 @@ func (c *OrderController) StoreOrderRank() {
|
|||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
//ctx := params.Ctx
|
ctx := params.Ctx
|
||||||
//if !auth2.IsV2Token(ctx.GetToken()) {
|
if !auth2.IsV2Token(ctx.GetToken()) {
|
||||||
// return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
|
return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
|
||||||
//}
|
}
|
||||||
//mobile, userID := ctx.GetMobileAndUserID()
|
mobile, userID := ctx.GetMobileAndUserID()
|
||||||
//if mobile == "" || userID == "" || userID == "null" || userID == "NULL" {
|
if mobile == "" || userID == "" || userID == "null" || userID == "NULL" {
|
||||||
// return nil, "", fmt.Errorf("不能得到用户手机号,%s,%s", userID, mobile)
|
return nil, "", fmt.Errorf("不能得到用户手机号,%s,%s", userID, mobile)
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
//if permission.IsRoled(ctx) {
|
if permission.IsRoled(ctx) {
|
||||||
// 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)
|
||||||
// mapDataList[v.Store.ID] = model.YES
|
mapDataList[v.Store.ID] = model.YES
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if len(storeIdList) != model.NO {
|
if len(storeIdList) != model.NO {
|
||||||
// for _, sl := range storeIdList {
|
for _, sl := range storeIdList {
|
||||||
// if mapDataList[sl] != model.YES {
|
if mapDataList[sl] != model.YES {
|
||||||
// return retVal, "", fmt.Errorf("此门店%d,不归属于该用户%s", sl, ctx.GetUserName())
|
return retVal, "", fmt.Errorf("此门店%d,不归属于该用户%s", sl, ctx.GetUserName())
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
//if len(storeIdList) == model.NO {
|
if len(storeIdList) == model.NO {
|
||||||
// storeIdList = dataList
|
storeIdList = dataList
|
||||||
//}
|
}
|
||||||
retVal, err = dao.StaticStoreOrderChange(dao.GetDB(), storeIdList, timeList[0], timeList[1], params.Rank)
|
retVal, err = dao.StaticStoreOrderChange(dao.GetDB(), storeIdList, timeList[0], timeList[1], params.Rank)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user