1
This commit is contained in:
@@ -396,7 +396,6 @@ func (c *OrderManager) SaveOrder(order *model.GoodsOrder, isAdjust bool, db *dao
|
||||
}
|
||||
_, _, err = db.Db.ReadOrCreate(originalOrder, "VendorOrderID", "VendorID")
|
||||
if created {
|
||||
globals.SugarLogger.Debugf("==========================order.sku := %s", utils.Format4Output(order.Skus, false))
|
||||
if err = dao.CreateMultiEntities(db, order.Skus); err != nil {
|
||||
baseapi.SugarLogger.Warnf("saveOrder orderID:%s, save order_sku failed with error:%v", order.VendorOrderID, err)
|
||||
}
|
||||
|
||||
@@ -101,7 +101,6 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
//var weight int = 0
|
||||
order.PmSubsidyMoney = *orderDetail.SkuDiscountPlatformFee // 平台承担优惠
|
||||
// 添加需要赠送的东西(暂时没有赠品套餐直接商品)
|
||||
globals.SugarLogger.Debugf("======orderDetail := %s", utils.Format4Output(orderDetail, false))
|
||||
multiSkuMap := make(map[int]int)
|
||||
if len(*orderDetail.SubOrderResponseList) > 0 {
|
||||
for _, extra := range *orderDetail.SubOrderResponseList {
|
||||
@@ -113,8 +112,8 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
StoreSubName: "",
|
||||
Count: utils.Float64TwoInt(*extra.BuySaleQuantity),
|
||||
VendorSkuID: *extra.SkuCode,
|
||||
SkuID: utils.Str2Int(*extra.SkuCode),
|
||||
JxSkuID: utils.Str2Int(*extra.SkuCode),
|
||||
SkuID: 0,
|
||||
JxSkuID: 0,
|
||||
SkuName: *extra.SkuName,
|
||||
ShopPrice: *extra.Price,
|
||||
VendorPrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity),
|
||||
@@ -127,7 +126,11 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
IsVendorAct: 0,
|
||||
Upc: *extra.Barcode,
|
||||
}
|
||||
|
||||
// extra.SkuCode 为int类型会超出长度,有时商品为平台创建
|
||||
if len(*extra.SkuCode) <= 10 {
|
||||
sku.SkuID = utils.Str2Int(*extra.SkuCode)
|
||||
sku.JxSkuID = utils.Str2Int(*extra.SkuCode)
|
||||
}
|
||||
activityId := make([]int64, 0)
|
||||
activityName := make([]string, 0)
|
||||
if extra.Activitys != nil {
|
||||
@@ -202,7 +205,6 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve
|
||||
order.OrderSeq = orderSeq + 1
|
||||
|
||||
// 包装袋金额
|
||||
globals.SugarLogger.Debugf("==============order := %s", utils.Format4Output(order, false))
|
||||
store, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), order.VendorStoreID, model.VendorIDTaoVegetable, order.VendorOrgCode)
|
||||
if store != nil {
|
||||
order.StoreName = store.Name // 真实门店名称
|
||||
|
||||
Reference in New Issue
Block a user