Update RebateCurrentService.php

This commit is contained in:
邹景立 2021-03-12 17:51:16 +08:00
parent b6ac1db1e3
commit 967249ec9b

View File

@ -126,7 +126,7 @@ class RebateCurrentService extends Service
$amount = $value ?: '0.00';
$name = "{$this->name(self::PRIZE_01)},每人 {$amount}";
} else {
$amount = $value * $this->order['amount_total'] / 100;
$amount = $value * $this->order['rebate_amount'] / 100;
$name = "{$this->name(self::PRIZE_01)},订单 {$value}%";
}
$this->app->db->name($this->table)->insert(array_merge($map, [
@ -160,7 +160,7 @@ class RebateCurrentService extends Service
$amount = $value ?: '0.00';
$name = "{$this->name(self::PRIZE_02)},每人 {$amount}";
} else {
$amount = $value * $this->order['amount_total'] / 100;
$amount = $value * $this->order['rebate_amount'] / 100;
$name = "{$this->name(self::PRIZE_02)},订单 {$value}%";
}
$this->app->db->name($this->table)->insert(array_merge($map, [
@ -188,7 +188,7 @@ class RebateCurrentService extends Service
$map = ['type' => self::PRIZE_03, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']];
if ($this->config("direct_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("direct_value_vip_{$key}");
$amount = $value * $this->order['amount_total'] / 100;
$amount = $value * $this->order['rebate_amount'] / 100;
$name = "{$this->name(self::PRIZE_03)},订单 {$value}%";
$this->app->db->name($this->table)->insert(array_merge($map, [
'uid' => $this->from1['id'], 'name' => $name, 'amount' => $amount, 'order_amount' => $this->order['amount_total'],
@ -214,7 +214,7 @@ class RebateCurrentService extends Service
$map = ['type' => self::PRIZE_04, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']];
if ($this->config("indirect_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("indirect_value_vip_{$key}");
$amount = $value * $this->order['amount_total'] / 100;
$amount = $value * $this->order['rebate_amount'] / 100;
$name = "{$this->name(self::PRIZE_04)},订单 {$value}%";
$this->app->db->name($this->table)->insert(array_merge($map, [
'uid' => $this->from2['id'], 'name' => $name, 'amount' => $amount, 'order_amount' => $this->order['amount_total'],