feat: 完善商品计奖隔离、积分商城兑换券抵扣与下线售后退款入口

这个提交包含在:
chen
2026-09-17 16:55:08 +08:00
父节点 f5b804fb57
当前提交 c3f5b3d4b5
共有 22 个文件被更改,包括 720 次插入 和 183 次删除

查看文件

@@ -607,11 +607,11 @@ class OrderCreate
public function calcVoucher()
{
$available = 0;
if ($this->user && $this->user->id && $this->order_type !== 'score') {
if ($this->user && $this->user->id) {
$available = (new \addons\shopro\service\partner\VoucherService())->available($this->user->id);
}
$this->orderData['voucher_available'] = $available;
$want = $this->order_type === 'score' ? 0 : max(0, round((float) $this->voucher_fee, 2));
$want = max(0, round((float) $this->voucher_fee, 2));
$apply = min($want, (float) $available, (float) $this->orderData['pay_fee']);
$apply = $apply > 0 ? $apply : 0;
$this->orderData['voucher_fee'] = $apply;