aa
This commit is contained in:
@@ -643,7 +643,13 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOr
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOrgCode string, actStoreSku []*ActStoreSkuParam) (err error) {
|
||||
func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorID int, vendorOrgCode string, actStoreSku []*ActStoreSkuParam) (err error) {
|
||||
if vendorID != model.VendorIDMTWM {
|
||||
return fmt.Errorf("此接口只支持美团使用!")
|
||||
}
|
||||
if act.Type != model.ActSkuDirectDown {
|
||||
return fmt.Errorf("此接口只支持创建直降!")
|
||||
}
|
||||
setActDefault(act)
|
||||
db := dao.GetDB()
|
||||
txDB, _ := dao.Begin(db)
|
||||
@@ -659,7 +665,18 @@ func CreateActForMtByOrder(ctx *jxcontext.Context, act *model.Act, vendorIDs []i
|
||||
dao.Rollback(db, txDB)
|
||||
return err
|
||||
}
|
||||
|
||||
actMap := &model.ActMap{
|
||||
ActID: act.ID,
|
||||
VendorID: vendorID,
|
||||
VendorOrgCode: vendorOrgCode,
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(actMap, ctx.GetUserName())
|
||||
err = dao.CreateEntityTx(txDB, actMap)
|
||||
if err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return err
|
||||
}
|
||||
dao.Commit(db, txDB)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user