aa
This commit is contained in:
@@ -644,12 +644,17 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOr
|
|||||||
return hint, err
|
return hint, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorID int, vendorOrgCode string, actStoreSku []*ActStoreSkuParam) (err error) {
|
func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOrgCode string, actStoreSku []*ActStoreSkuParam) (err error) {
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
actStoreSkuMap = make(map[int][]*model.StoreSkuBind)
|
actStoreSkuMap = make(map[int][]*model.StoreSkuBind)
|
||||||
err2 = ""
|
err2 = ""
|
||||||
|
vendorID int
|
||||||
)
|
)
|
||||||
|
if len(vendorIDs) > 0 {
|
||||||
|
return fmt.Errorf("只允许单平台创建!")
|
||||||
|
}
|
||||||
|
vendorID = vendorIDs[0]
|
||||||
if vendorID != model.VendorIDMTWM {
|
if vendorID != model.VendorIDMTWM {
|
||||||
return fmt.Errorf("此接口只支持美团使用!")
|
return fmt.Errorf("此接口只支持美团使用!")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ func (c *ActController) CreateAct() {
|
|||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param name formData string true "活动名,必须唯一(所以名子上最好带上日期)"
|
// @Param name formData string true "活动名,必须唯一(所以名子上最好带上日期)"
|
||||||
// @Param type formData int true "活动类型,3:直降"
|
// @Param type formData int true "活动类型,3:直降"
|
||||||
// @Param vendorID formData int true "厂商ID,当前只支持,美团"
|
// @Param vendorIDs formData string true "厂商ID,当前只支持,京东:0,京西(用于记录活动信息):99"
|
||||||
// @Param vendorOrgCode formData string true "厂商内组织代码"
|
// @Param vendorOrgCode formData string true "厂商内组织代码"
|
||||||
// @Param beginAt formData string true "开始日期"
|
// @Param beginAt formData string true "开始日期"
|
||||||
// @Param endAt formData string true "结束日期"
|
// @Param endAt formData string true "结束日期"
|
||||||
@@ -141,8 +141,10 @@ func (c *ActController) CreateActForMtByOrder() {
|
|||||||
c.callCreateActForMtByOrder(func(params *tActCreateActForMtByOrderParams) (retVal interface{}, errCode string, err error) {
|
c.callCreateActForMtByOrder(func(params *tActCreateActForMtByOrderParams) (retVal interface{}, errCode string, err error) {
|
||||||
var (
|
var (
|
||||||
actStoreSkuList []*act.ActStoreSkuParam
|
actStoreSkuList []*act.ActStoreSkuParam
|
||||||
|
vendorIDs []int
|
||||||
)
|
)
|
||||||
timeList, err := jxutils.BatchStr2Time(params.BeginAt, params.EndAt)
|
timeList, err := jxutils.BatchStr2Time(params.BeginAt, params.EndAt)
|
||||||
|
jxutils.Strings2Objs(params.VendorIDs, &vendorIDs)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if err = jxutils.Strings2Objs(params.ActStoreSkuList, &actStoreSkuList); err == nil {
|
if err = jxutils.Strings2Objs(params.ActStoreSkuList, &actStoreSkuList); err == nil {
|
||||||
actObj := &model.Act{
|
actObj := &model.Act{
|
||||||
@@ -155,7 +157,7 @@ func (c *ActController) CreateActForMtByOrder() {
|
|||||||
Advertising: params.Advertising,
|
Advertising: params.Advertising,
|
||||||
}
|
}
|
||||||
//retVal, err = act.CreateAct(params.Ctx, actObj, vendorIDs, params.VendorOrgCode, nil, actStoreSkuList, params.IsAsync)
|
//retVal, err = act.CreateAct(params.Ctx, actObj, vendorIDs, params.VendorOrgCode, nil, actStoreSkuList, params.IsAsync)
|
||||||
err = act.CreateActForMtByOrder(params.Ctx, actObj, params.VendorID, params.VendorOrgCode, actStoreSkuList)
|
err = act.CreateActForMtByOrder(params.Ctx, actObj, vendorIDs, params.VendorOrgCode, actStoreSkuList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "success", "", err
|
return "success", "", err
|
||||||
|
|||||||
Reference in New Issue
Block a user