feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录
这个提交包含在:
@@ -123,15 +123,19 @@ class VoucherService
|
||||
}
|
||||
}
|
||||
|
||||
public function grant($order, $buyerId)
|
||||
public function grant($order, $buyerId, $rules = null)
|
||||
{
|
||||
$exists = VoucherPlan::where('order_id', $order['id'])->find();
|
||||
if ($exists) {
|
||||
return $exists;
|
||||
}
|
||||
|
||||
$times = (float) PartnerConfig::get('partner_voucher_times', 1.5);
|
||||
$days = intval(PartnerConfig::get('partner_voucher_days', 365));
|
||||
$times = (isset($rules['voucher_times']) && is_numeric($rules['voucher_times']))
|
||||
? (float) $rules['voucher_times']
|
||||
: (float) PartnerConfig::get('partner_voucher_times', 1.5);
|
||||
$days = (isset($rules['voucher_days']) && is_numeric($rules['voucher_days']))
|
||||
? intval($rules['voucher_days'])
|
||||
: intval(PartnerConfig::get('partner_voucher_days', 365));
|
||||
$days = $days > 0 ? $days : 365;
|
||||
$rewardService = new PartnerRewardService();
|
||||
$qualifiedPayFee = $rewardService->getQualifiedPayFee($order);
|
||||
|
||||
在新工单中引用
屏蔽一个用户