+ 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)
|
storeIDs, skuIDs = GetStoreAndSkuIDsFromInfo(skuNamesInfo)
|
||||||
}
|
}
|
||||||
beginTime := time.Now()
|
beginTime := time.Now()
|
||||||
err = updateActPrice4StoreSkuName(db, storeIDs, skuIDs, skuNamesInfo)
|
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))
|
globals.SugarLogger.Debugf("GetStoresSkusNew updateActPrice4StoreSkuName:%v", time.Now().Sub(beginTime))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,11 @@ func (c *DjswController) SinglePromoteCreate() {
|
|||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
obj, callbackResponse := api.JdAPI.GetOrderCallbackMsg(getUsefulRequest(c.Ctx))
|
obj, callbackResponse := api.JdAPI.GetOrderCallbackMsg(getUsefulRequest(c.Ctx))
|
||||||
if callbackResponse == nil {
|
if callbackResponse == nil {
|
||||||
callbackResponse = promotion.OnNewPromotionMsg(obj)
|
if globals.EnableNewAct {
|
||||||
|
callbackResponse = jd.OnActMsg(obj)
|
||||||
|
} else {
|
||||||
|
callbackResponse = promotion.OnNewPromotionMsg(obj)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
c.Data["json"] = c.transferResponse("SinglePromoteCreate", callbackResponse)
|
c.Data["json"] = c.transferResponse("SinglePromoteCreate", callbackResponse)
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"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"
|
"github.com/astaxie/beego"
|
||||||
|
|
||||||
@@ -36,6 +40,11 @@ type PromotionController struct {
|
|||||||
// @router /CreatePromotion [post]
|
// @router /CreatePromotion [post]
|
||||||
func (c *PromotionController) CreatePromotion() {
|
func (c *PromotionController) CreatePromotion() {
|
||||||
c.callCreatePromotion(func(params *tPromotionCreatePromotionParams) (retVal interface{}, errCode string, err error) {
|
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)
|
beginAt, err := utils.TryStr2Time(params.BeginAt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ var (
|
|||||||
GetWeixinTokenKey string
|
GetWeixinTokenKey string
|
||||||
|
|
||||||
StoreName string
|
StoreName string
|
||||||
|
|
||||||
|
EnableNewAct bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user