流量池单价
This commit is contained in:
parent
cf058f7d8f
commit
72febb1e8d
@ -96,7 +96,7 @@ class FlowPoolSync extends Command
|
||||
|
||||
$settingData = [
|
||||
'pool_id' => $id,
|
||||
'gradient_price' => intval($dp_billing_rules['first_month_price']) * 100,
|
||||
'gradient_price' => intval($dp_billing_rules['first_month_price']) * 10000,
|
||||
'gradient' => floatval($dp_billing_rules['data_step_num']),
|
||||
'gradient_unit' => $dp_billing_rules['data_step_num_unit'] === 'M' ? 0 : 1,
|
||||
'start_at' => $start_at,
|
||||
|
@ -177,8 +177,8 @@ class FlowPoolService extends Service
|
||||
$flowPool->members = $flowArry['members'];
|
||||
$flowPool->minimum_flows = $this->humanFlows($flowArry['minimum_flows']);
|
||||
$flowPool->excess_flows = $this->humanFlows($flowArry['excess_flows']);
|
||||
$flowPool->minimum_price = sprintf('%.02f', $flowArry['minimum_price'] / 100);
|
||||
$flowPool->excess_price = sprintf('%.02f', $flowArry['excess_price'] / 100);
|
||||
$flowPool->minimum_price = sprintf('%.02f', $flowArry['minimum_price'] / 10000);
|
||||
$flowPool->excess_price = sprintf('%.02f', $flowArry['excess_price'] / 10000);
|
||||
$flowPool->total_price = sprintf('%.02f', $flowPool->minimum_price + $flowPool->excess_price);
|
||||
|
||||
return $flowPool;
|
||||
@ -267,7 +267,7 @@ class FlowPoolService extends Service
|
||||
{
|
||||
$attributes['start_at'] = Carbon::parse($attributes['start_at'])->startOfMonth()->format('Y-m-d H:i:s');
|
||||
$attributes['end_at'] = Carbon::parse($attributes['end_at'])->endOfMonth()->format('Y-m-d H:i:s');
|
||||
$attributes['gradient_price'] = intval($attributes['gradient_price'] * 100);
|
||||
$attributes['gradient_price'] = intval($attributes['gradient_price'] * 10000);
|
||||
$attributes['gradient'] = floatval($attributes['gradient']);
|
||||
|
||||
if (!is_array($attributes['minimum_settings'])) {
|
||||
@ -686,7 +686,7 @@ class FlowPoolService extends Service
|
||||
$settings = $item->settings;
|
||||
|
||||
foreach ($settings as &$setting) {
|
||||
$setting['gradient_price'] = sprintf('%.02f', $setting['gradient_price'] / 100);
|
||||
$setting['gradient_price'] = sprintf('%.04f', $setting['gradient_price'] / 10000);
|
||||
$setting['gradient'] = sprintf('%.02f', $setting['gradient']);
|
||||
$minimum_settings = $setting['minimum_settings'] ?? [];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user