修复:商品独立设置提成时 在只设置文创等级的情况下提成可能奖励失败的问题
This commit is contained in:
parent
48d4c7ed35
commit
fc4cb9a9ed
|
|
@ -95,10 +95,6 @@ class OrderCreatedListener
|
|||
$TeamReturnService->setData($order, $set, $buyMember, $order_goods, $agents);
|
||||
$TeamReturnService->handle();
|
||||
$this->totalDividend += $TeamReturnService->totalDividend;
|
||||
// 文创津贴(补贴)处理
|
||||
// $TeamReturnService->setData($order, $set, $buyMember, $order_goods, $agents,1);
|
||||
// $TeamReturnService->handle();
|
||||
// $this->totalDividend += $TeamReturnService->totalDividend;
|
||||
}
|
||||
// 订单插件分红记录
|
||||
(new OrderBonusJob('yz_team_dividend', 'team-dividend', 'order_sn', 'order_sn', 'dividend_amount', $order, $this->totalDividend))->handle();
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class GetAmountService
|
|||
$award_hierarchy = $this->dividendType == 1 ? $this->agent['cultural_level']['award_hierarchy'] : $this->agent['has_one_level']['award_hierarchy'];
|
||||
if ($this->hasPeers()) {
|
||||
$hierarchys = $this->getHierarchys();
|
||||
$hierarchy_level = $hierarchys[$this->agent['level']];
|
||||
$hierarchy_level = $hierarchys[$this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level']];
|
||||
if ($hierarchy_level && $hierarchy_level['hierarchy'] > 0) {
|
||||
$award_hierarchy = $hierarchy_level['hierarchy'];
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ class GetAmountService
|
|||
$ratio = $this->dividendType == 1 ? $this->agent['cultural_level']['award_ratio'] : $this->agent['has_one_level']['award_ratio'];
|
||||
if ($this->hasPeers()) {
|
||||
$hierarchys = $this->getHierarchys();
|
||||
$hierarchy_level = $hierarchys[$this->agent['level']];
|
||||
$hierarchy_level = $hierarchys[$this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level']];
|
||||
$ratio = $hierarchy_level['ratio'];
|
||||
}
|
||||
return $ratio;
|
||||
|
|
@ -192,7 +192,7 @@ class GetAmountService
|
|||
if ($this->hasDividend()) {
|
||||
if ($this->hasDividendRates()) {
|
||||
$dividend_rates = $this->getDividendRates();
|
||||
$ratio = $dividend_rates['level_' . $this->agent['level']];
|
||||
$ratio = $dividend_rates['level_' . ($this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level'])];
|
||||
if (isset($ratio) && $ratio > 0) {
|
||||
// 提成结算金额
|
||||
$amount = $this->order_goods->payment_amount;
|
||||
|
|
@ -204,7 +204,7 @@ class GetAmountService
|
|||
if ($this->hasDividendPrices()) {
|
||||
$dividend_prices = $this->getDividendPrices();
|
||||
// 提成结算金额
|
||||
$amount = $this->order_goods->total * $dividend_prices['level_' . $this->agent['level']];
|
||||
$amount = $this->order_goods->total * $dividend_prices['level_' . ($this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level'])];
|
||||
}
|
||||
}
|
||||
if ($this->order->plugin_id == 48 && app('plugins')->isEnabled('hotel-supply')) {
|
||||
|
|
@ -252,7 +252,7 @@ class GetAmountService
|
|||
\Log::debug('经销商特殊结算商城商品1---',$this->order_goods->payment_amount);
|
||||
$dividend_prices = $this->getDividendPrices();
|
||||
// 提成结算金额
|
||||
$this->amount = $this->order_goods->total * $dividend_prices['level_' . $this->agent['level']];
|
||||
$this->amount = $this->order_goods->total * $dividend_prices['level_' . ($this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level'])];
|
||||
$this->fixed = 1;
|
||||
$this->ratio = 0;
|
||||
// 奖励金额
|
||||
|
|
@ -309,8 +309,8 @@ class GetAmountService
|
|||
// 商城商品设置奖励比例 else 商城商品设置奖励固定金额
|
||||
if ($this->hasDividendRates()) {
|
||||
$dividend_rates = $this->getDividendRates();
|
||||
$ratio = bcsub($dividend_rates['level_'. $this->agent['level']], $this->finish_ratio,2);
|
||||
$this->finish_ratio = $dividend_rates['level_' . $this->agent['level']];
|
||||
$ratio = bcsub($dividend_rates['level_'. ($this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level'])], $this->finish_ratio,2);
|
||||
$this->finish_ratio = $dividend_rates['level_' . ($this->dividendType == 1 ? $this->agent['cultural_level_id'] : $this->agent['level'])];
|
||||
return $ratio;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@ class TeamReturnService
|
|||
|
||||
|
||||
|
||||
public function setData($order, $set, $buyMember, $order_goods, $agents, $dividendType = 0){
|
||||
$this->dividendType = $dividendType;
|
||||
public function setData($order, $set, $buyMember, $order_goods, $agents){
|
||||
$this->order = $order;
|
||||
$this->set = $set;
|
||||
$this->buyMember = $buyMember;
|
||||
|
|
@ -85,7 +84,7 @@ class TeamReturnService
|
|||
$this->running();
|
||||
// 文创处理
|
||||
$this->flat_prize_limit = 0;
|
||||
$this->dividendType = 1;
|
||||
$this->dividendType = 1;
|
||||
$this->init();
|
||||
$this->totalDividend();
|
||||
$this->running();
|
||||
|
|
|
|||
Loading…
Reference in New Issue