作者 唐旭辉

修复:bug-16 bug-24

... ... @@ -814,6 +814,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List
"partner_name": result[i].PartnerName,
"bonus_status": "",
"update_time": result[i].UpdateTime,
"create_time": result[i].CreateTime,
"partner_bonus": fmt.Sprint(result[i].PartnerBonus),
"partner_bonus_has": fmt.Sprint(result[i].PartnerBonusHas),
"partner_bonus_not": fmt.Sprint(result[i].PartnerBonusNot),
... ...
... ... @@ -393,7 +393,9 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i
e := fmt.Sprintf("获取管理员用户(id=%d)数据失败,%s", adminId, err)
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
}
var payEvents []event.PayOrderGoodBonus
var (
payEvents []event.PayOrderGoodBonus
)
for _, orderId := range orderIds {
var oldOrder *domain.OrderBase
oldOrder, err = orderBaseReponsitory.FindOne(domain.OrderBaseFindOneQuery{OrderId: orderId})
... ... @@ -440,17 +442,19 @@ func (serve *OrderBonusService) BatchPayPartnerBonus(orderIds []int64, adminId i
if err != nil {
return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
//构建事件
payEvent := event.PayOrderGoodBonus{
OrderBase: oldOrder,
Goods: updateGoods,
Admin: &adminUser,
}
payEvents = append(payEvents, payEvent)
}
//构建事件
payEvent := event.PayOrderGoodBonus{
OrderBase: oldOrder,
Goods: updateGoods,
Admin: &adminUser,
}
payEvents = append(payEvents, payEvent)
}
if err = serve.Publish(event.BatchPayOrderGoodBonus(payEvents)); err != nil {
return err
if len(payEvents) > 0 {
if err = serve.Publish(event.BatchPayOrderGoodBonus(payEvents)); err != nil {
return err
}
}
return nil
}
... ...