feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录
这个提交包含在:
@@ -66,7 +66,7 @@ class OrderCreate
|
||||
/**
|
||||
* 用户选择的兑换券抵扣金额
|
||||
*/
|
||||
protected $voucher_fee = 0;
|
||||
protected $voucher_fee = null;
|
||||
|
||||
/**
|
||||
* 用户备注
|
||||
@@ -158,7 +158,7 @@ class OrderCreate
|
||||
$this->invoice_id = $params['invoice_id'] ?? 0;
|
||||
|
||||
$this->coupon_id = $params['coupon_id'] ?? 0;
|
||||
$this->voucher_fee = isset($params['voucher_fee']) ? floatval($params['voucher_fee']) : 0;
|
||||
$this->voucher_fee = (isset($params['voucher_fee']) && $params['voucher_fee'] !== '') ? floatval($params['voucher_fee']) : null;
|
||||
$this->remark = $params['remark'] ?? '';
|
||||
|
||||
$this->money = (isset($params['money']) && $params['money'] > 0) ? $params['money'] : 0;
|
||||
@@ -611,7 +611,14 @@ class OrderCreate
|
||||
$available = (new \addons\shopro\service\partner\VoucherService())->available($this->user->id);
|
||||
}
|
||||
$this->orderData['voucher_available'] = $available;
|
||||
$want = max(0, round((float) $this->voucher_fee, 2));
|
||||
|
||||
// 兑换商城订单:若未显式指定抵扣额度,默认自动全额应用可用兑换券
|
||||
if ($this->voucher_fee === null) {
|
||||
$want = $this->order_type == 'score' ? (float) $available : 0;
|
||||
} else {
|
||||
$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;
|
||||
|
||||
在新工单中引用
屏蔽一个用户