intval
This commit is contained in:
parent
b6404dd242
commit
88f9868f0b
@ -102,7 +102,7 @@ class AddedOrderSync extends Command
|
||||
|
||||
foreach ($orders as &$item) {
|
||||
$item['company_id'] = $this->companies[$item['company_id']]['id'] ?? 0;
|
||||
$item['total_price'] = floatval($item['total_price']) * 100;
|
||||
$item['total_price'] = intval($item['total_price']) * 100;
|
||||
$item['counts'] = !empty($item['counts']) ? $item['counts'] : 1;
|
||||
$item['pay_channel'] = CommonService::transformerPayChannel($item['pay_channel']);
|
||||
$item['unit_price'] = intval($item['total_price']/$item['counts']);
|
||||
@ -137,7 +137,7 @@ class AddedOrderSync extends Command
|
||||
$item['order_id'] = $orders[$item['order_sn']]['id'] ?? 0;
|
||||
$item['company_id'] = $orders[$item['order_sn']]['company_id'] ?? 0;
|
||||
$item['package_id'] = $this->packages[$item['package_id']]['id'] ?? 0;
|
||||
$item['unit_price'] = floatval($item['unit_price']) * 100;
|
||||
$item['unit_price'] = intval($item['unit_price']) * 100;
|
||||
}
|
||||
|
||||
$this->types = array_pluck($orderItems, 'type', 'order_sn');
|
||||
|
@ -216,8 +216,8 @@ class PackageSync extends Command
|
||||
$package['id'] = ($package['type'] + 1) * 1000000 + $package['id'];
|
||||
$package['parent_id'] = $package['parent_id'] ?? 0;
|
||||
$package['carrier_operator'] = self::$carrier_operator[$package['carrier_operator']] ?? 255;
|
||||
$package['cost_price'] = floatval($package['cost_price']) * 100;
|
||||
$package['guide_price'] = floatval($package['guide_price']) * 100;
|
||||
$package['cost_price'] = intval($package['cost_price']) * 100;
|
||||
$package['guide_price'] = intval($package['guide_price']) * 100;
|
||||
$package['flows'] = intval($package['flows']);
|
||||
$package['voices'] = intval($package['voices']);
|
||||
$package['messages'] = intval($package['messages']);
|
||||
|
@ -68,8 +68,8 @@ class LogSync extends Command
|
||||
$value = (array)$value;
|
||||
|
||||
$package = $this->getPackage($value['content']);
|
||||
$unit_price = floatval($value['sale_account']) * 100;
|
||||
$custom_price = floatval($value['order_account']) * 100;
|
||||
$unit_price = intval($value['sale_account']) * 100;
|
||||
$custom_price = intval($value['order_account']) * 100;
|
||||
$product = $this->getProduct($package, $value['company'], $unit_price);
|
||||
$type = self::$types[$value['type']];
|
||||
$pay_channel = self::$payChannels[$value['pay_type']];
|
||||
|
@ -33,7 +33,7 @@ class ProductSync extends Command
|
||||
throw new \Exception('套餐不存在');
|
||||
}
|
||||
|
||||
$base_price = floatval($value['sale_account']) * 100;
|
||||
$base_price = intval($value['sale_account']) * 100;
|
||||
|
||||
$products[] = [
|
||||
'sn' => strtoupper($package['sn'] . '_' . $value['company'] . '_' . $base_price),
|
||||
|
@ -106,10 +106,10 @@ class PackageService extends Service
|
||||
|
||||
Validator::validate($attributes, $rule, $message);
|
||||
|
||||
$attributes['cost_price'] = floatval($attributes['cost_price']) * 100;
|
||||
$attributes['guide_price'] = floatval($attributes['guide_price']) * 100;
|
||||
$attributes['renewal_cost_price'] = floatval($attributes['renewal_cost_price']) * 100;
|
||||
$attributes['renewal_guide_price'] = floatval($attributes['renewal_guide_price']) * 100;
|
||||
$attributes['cost_price'] = intval($attributes['cost_price']) * 100;
|
||||
$attributes['guide_price'] = intval($attributes['guide_price']) * 100;
|
||||
$attributes['renewal_cost_price'] = intval($attributes['renewal_cost_price']) * 100;
|
||||
$attributes['renewal_guide_price'] = intval($attributes['renewal_guide_price']) * 100;
|
||||
|
||||
if (!$attributes['id']) {
|
||||
$maxId = Package::withTrashed()->where('type', $attributes['type'])->max('id');
|
||||
|
@ -57,8 +57,8 @@ class ProductService extends Service
|
||||
*/
|
||||
public function store(array $attributes = [])
|
||||
{
|
||||
$attributes['base_price'] = floatval($attributes['base_price']) * 100;
|
||||
$attributes['renewal_price'] = floatval($attributes['renewal_price']) * 100;
|
||||
$attributes['base_price'] = intval($attributes['base_price']) * 100;
|
||||
$attributes['renewal_price'] = intval($attributes['renewal_price']) * 100;
|
||||
|
||||
$rule = [
|
||||
'name' => ['required', 'between:2,32'],
|
||||
|
@ -53,14 +53,14 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="ui-list" v-if="!type">
|
||||
<li class="ui-list" v-if="type">
|
||||
<div class="ui-list-title">生效延迟</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(0)" :max="100000" :min="0" :step="1" v-model="params.effect_months"></InputNumber> 月
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="ui-list" v-if="!type">
|
||||
<li class="ui-list" v-if="type">
|
||||
<div class="ui-list-title">服务延长</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(0)" :max="100000" :min="0" :step="1" v-model="params.delay_months"></InputNumber> 月
|
||||
|
Loading…
x
Reference in New Issue
Block a user