作者 唐旭辉

修复bug

@@ -226,21 +226,20 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord @@ -226,21 +226,20 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord
226 good := domain.NewOrderGood() 226 good := domain.NewOrderGood()
227 orderBestshop.Goods[i].CopyToOrderGood(&good) 227 orderBestshop.Goods[i].CopyToOrderGood(&good)
228 good.OrderId = orderbase.Id 228 good.OrderId = orderbase.Id
  229 + good.CompanyId = partnerData.CompanyId
229 good.Compute() 230 good.Compute()
230 good.CurrentBonusStatus.WartPayPartnerBonus(&good) 231 good.CurrentBonusStatus.WartPayPartnerBonus(&good)
231 ordergoods = append(ordergoods, good) 232 ordergoods = append(ordergoods, good)
232 } 233 }
233 orderbase.Goods = ordergoods 234 orderbase.Goods = ordergoods
234 orderbase.PartnerId = orderBestshop.PartnerId 235 orderbase.PartnerId = orderBestshop.PartnerId
  236 + orderbase.CompanyId = partnerData.CompanyId
235 orderbase.Compute() 237 orderbase.Compute()
236 err = orderBaseRepository.Save(&orderbase) 238 err = orderBaseRepository.Save(&orderbase)
237 if err != nil { 239 if err != nil {
238 e := fmt.Sprintf("添加order_base数据失败%s", err) 240 e := fmt.Sprintf("添加order_base数据失败%s", err)
239 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e) 241 return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
240 } 242 }
241 - for i := range ordergoods {  
242 - ordergoods[i].OrderId = orderbase.Id  
243 - }  
244 // 添加goods 243 // 添加goods
245 err = orderGoodRepository.Save(ordergoods) 244 err = orderGoodRepository.Save(ordergoods)
246 if err != nil { 245 if err != nil {
@@ -221,6 +221,8 @@ func (good *OrderGood) Compute() error { @@ -221,6 +221,8 @@ func (good *OrderGood) Compute() error {
221 var partnerBonusPercent float64 221 var partnerBonusPercent float64
222 if good.PartnerBonusPercent < 0 { 222 if good.PartnerBonusPercent < 0 {
223 partnerBonusPercent = 0 223 partnerBonusPercent = 0
  224 + } else {
  225 + partnerBonusPercent = good.PartnerBonusPercent
224 } 226 }
225 //price*useGoodNumber 227 //price*useGoodNumber
226 planPartnerBonus := planamount.Mul(decimal.NewFromFloat(partnerBonusPercent)).Div(decimal.NewFromInt(100)) //price*planGoodNumber*PartnerBonusPercent 228 planPartnerBonus := planamount.Mul(decimal.NewFromFloat(partnerBonusPercent)).Div(decimal.NewFromInt(100)) //price*planGoodNumber*PartnerBonusPercent