+ globals.EnableNewAct
This commit is contained in:
@@ -429,7 +429,11 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo
|
||||
storeIDs, skuIDs = GetStoreAndSkuIDsFromInfo(skuNamesInfo)
|
||||
}
|
||||
beginTime := time.Now()
|
||||
if globals.EnableNewAct {
|
||||
err = updateActPrice4StoreSkuNameNew(db, storeIDs, skuIDs, skuNamesInfo)
|
||||
} else {
|
||||
err = updateActPrice4StoreSkuName(db, storeIDs, skuIDs, skuNamesInfo)
|
||||
}
|
||||
globals.SugarLogger.Debugf("GetStoresSkusNew updateActPrice4StoreSkuName:%v", time.Now().Sub(beginTime))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +126,12 @@ func (c *DjswController) SinglePromoteCreate() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
obj, callbackResponse := api.JdAPI.GetOrderCallbackMsg(getUsefulRequest(c.Ctx))
|
||||
if callbackResponse == nil {
|
||||
if globals.EnableNewAct {
|
||||
callbackResponse = jd.OnActMsg(obj)
|
||||
} else {
|
||||
callbackResponse = promotion.OnNewPromotionMsg(obj)
|
||||
}
|
||||
}
|
||||
c.Data["json"] = c.transferResponse("SinglePromoteCreate", callbackResponse)
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
|
||||
@@ -36,6 +40,11 @@ type PromotionController struct {
|
||||
// @router /CreatePromotion [post]
|
||||
func (c *PromotionController) CreatePromotion() {
|
||||
c.callCreatePromotion(func(params *tPromotionCreatePromotionParams) (retVal interface{}, errCode string, err error) {
|
||||
if globals.EnableNewAct {
|
||||
if params.VendorID == model.VendorIDJD {
|
||||
return retVal, "", fmt.Errorf("请使用新版活动管理创建平台活动")
|
||||
}
|
||||
}
|
||||
beginAt, err := utils.TryStr2Time(params.BeginAt)
|
||||
if err != nil {
|
||||
return retVal, "", err
|
||||
|
||||
@@ -43,6 +43,8 @@ var (
|
||||
GetWeixinTokenKey string
|
||||
|
||||
StoreName string
|
||||
|
||||
EnableNewAct bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user