|
|
@@ -213,6 +213,10 @@ abstract class ActivityCalc {
|
|
|
$result = 1;
|
|
|
$reparation = bcmul(bcsub($product['paid'], $product['cost'], 2), $this->repRate(), 2);
|
|
|
}
|
|
|
+ if ($reparation < 0.0) {
|
|
|
+ log::warning("reparation = $reparation, orderId=" . $product['id']);
|
|
|
+ $reparation = 0.0;
|
|
|
+ }
|
|
|
// 标记商品为已参与活动
|
|
|
$r1 = StoreOrderCartInfo::where('oid', $product['id'])
|
|
|
->where('product_id', $product['product_id'])
|
|
|
@@ -249,8 +253,8 @@ abstract class ActivityCalc {
|
|
|
// 中奖用户发送中奖消息.
|
|
|
UserNotice::sendNoticeTo($product['uid'], '您的订单已退款',
|
|
|
'您好,由于活动商品库存有限,您的订单 ' . $product['store_name']
|
|
|
- . ' 未能成功分配。 该商品付款' . $product['paid'] . '元已如数退还,并赔付您' . $reparation
|
|
|
- . '元作为补偿,对您造成的不便我们深感抱歉。同时感谢您对美天旺的信任和喜爱,祝您生活愉快。', $product['image']);
|
|
|
+ . ' 未能成功发货。 该商品付款' . $product['paid'] . '元已如数退还,并赔付您' . $reparation
|
|
|
+ . '元作为补偿,请在“我的佣金”中核实。对您造成的不便我们深感抱歉。感谢您对我们的信任和喜爱,美天旺祝您生活愉快。', $product['image']);
|
|
|
}
|
|
|
}
|
|
|
|