刷新物料订单的标志,每周刷新一次,每周只能申请一次
This commit is contained in:
@@ -2,6 +2,7 @@ package orderman
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -1209,10 +1210,16 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde
|
||||
err = dao.GetRows(db, &orderPays, sql, sqlParams)
|
||||
if len(orderPays) != 0 {
|
||||
orderPay := orderPays[0]
|
||||
if time.Now().Sub(*orderPay.PayFinishedAt).Hours() < 24*7 {
|
||||
flag = false
|
||||
stores, _ := dao.GetStoreList(db, []int{storeID}, nil, nil, nil, "")
|
||||
if len(stores) > 0 {
|
||||
store := stores[0]
|
||||
if store.IsBoughtMatter == model.YES {
|
||||
flag = false
|
||||
} else {
|
||||
flag = true
|
||||
}
|
||||
} else {
|
||||
flag = true
|
||||
flag = false
|
||||
}
|
||||
orderTime = *orderPay.PayFinishedAt
|
||||
} else {
|
||||
@@ -1235,6 +1242,7 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
orderCount.Count = int(utils.Float64TwoInt64(math.Ceil(utils.Int2Float64(orderCount.Count) * 1.5)))
|
||||
orderCount.Flag = flag
|
||||
// orderCount.Count = 1000
|
||||
return orderCount, err
|
||||
|
||||
Reference in New Issue
Block a user