1
This commit is contained in:
@@ -338,14 +338,19 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
|
||||
// 创建子商品
|
||||
temp, err := dao.QueryStoreBindInfo(storeDetail.ID)
|
||||
globals.SugarLogger.Debugf("er2==============err创建子商品%s", utils.Format4Output(temp, false))
|
||||
if err != nil || temp == nil || temp.TemplateID == 0 {
|
||||
// 运费模板
|
||||
param.FreightId, err = GetDeliveryTemp(api, vendorStoreID, storeDetail)
|
||||
globals.SugarLogger.Debugf("er2==============FreightId%s", utils.Format4Output(param.FreightId, false))
|
||||
globals.SugarLogger.Debugf("er2==============FreightId%s", utils.Format4Output(err, false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 获取门店限售模板
|
||||
param.SaleLimitId, err = CreateSaleTemp(utils.Str2Int64(vendorStoreID), api)
|
||||
globals.SugarLogger.Debugf("er2==============SaleLimitId%s", utils.Format4Output(param.SaleLimitId, false))
|
||||
globals.SugarLogger.Debugf("er2==============SaleLimitId%s", utils.Format4Output(err, false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -359,7 +364,8 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
TradeLimitID: param.SaleLimitId,
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(param, "jxAdmin")
|
||||
dao.CreateEntity(dao.GetDB(), &freightTemplate)
|
||||
err = dao.CreateEntity(dao.GetDB(), &freightTemplate)
|
||||
globals.SugarLogger.Debugf("er2==============CreateEntity%s", utils.Format4Output(err, false))
|
||||
} else {
|
||||
param.FreightId = temp.TemplateID
|
||||
param.SaleLimitId = temp.TradeLimitID
|
||||
|
||||
Reference in New Issue
Block a user