- UpdateStoresSkusSale中对于autoSaleAt按服务器设置处理,不管客户端传的具体值
This commit is contained in:
@@ -163,6 +163,8 @@ type tGetStoresSkusInfo struct {
|
||||
const (
|
||||
maxStoreNameBind = 3000 // 最大门店SkuName bind个数
|
||||
maxStoreNameBind2 = 10000 // 最大门店乘SkuName个数
|
||||
|
||||
AutoSaleAtStr = "20:25:00"
|
||||
)
|
||||
|
||||
func GetStoreSkus(ctx *jxcontext.Context, storeID int, skuIDs []int, isFocus bool, keyword string, isBySku bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *StoreSkuNamesInfo, err error) {
|
||||
@@ -1307,6 +1309,15 @@ func getSkuSaleStatus(inSkuBind *StoreSkuBindSkuInfo, skuBindInfo *StoreSkuBindI
|
||||
return model.StoreSkuBindStatusNA
|
||||
}
|
||||
|
||||
func formatAutoSaleTime(autoSaleTime time.Time) (outAutoSaleTime time.Time) {
|
||||
if utils.IsTimeZero(autoSaleTime) {
|
||||
outAutoSaleTime = utils.DefaultTimeValue
|
||||
} else {
|
||||
outAutoSaleTime = jxutils.GetNextTimeFromList(time.Now(), []string{AutoSaleAtStr})
|
||||
}
|
||||
return outAutoSaleTime
|
||||
}
|
||||
|
||||
// todo 应该用updateStoresSkusWithoutSync实现
|
||||
func updateStoreSkusSaleWithoutSync(ctx *jxcontext.Context, storeID int, skuBindSkuInfos []*StoreSkuBindSkuInfo, autoSaleTime time.Time, userName string) (needSyncSkus []int, err error) {
|
||||
var num int64
|
||||
@@ -1331,6 +1342,7 @@ func updateStoreSkusSaleWithoutSync(ctx *jxcontext.Context, storeID int, skuBind
|
||||
dao.Rollback(db)
|
||||
return nil, err
|
||||
}
|
||||
autoSaleTime = formatAutoSaleTime(autoSaleTime)
|
||||
for _, skuBind := range storeSkuList {
|
||||
if v := skuBindSkuInfosMap[skuBind.SkuID]; v != nil && v.IsSale != 0 {
|
||||
if v.IsSale == 1 {
|
||||
|
||||
@@ -52,7 +52,7 @@ var (
|
||||
}
|
||||
|
||||
autoSaleStoreSkuTimeList = []string{
|
||||
"20:20:00",
|
||||
cms.AutoSaleAtStr,
|
||||
}
|
||||
|
||||
importantTaskMap = &sync.Map{}
|
||||
|
||||
@@ -3,9 +3,9 @@ package model
|
||||
type AppKeyConfig struct {
|
||||
ModelIDCULD
|
||||
VendorID int
|
||||
AppKey string // 同一平台下不同的Key
|
||||
AppCode string // 同一平台下不同的商户代码
|
||||
|
||||
Name string
|
||||
AppName string
|
||||
AppType int
|
||||
Value1 string
|
||||
Value2 string
|
||||
|
||||
Reference in New Issue
Block a user