intval
This commit is contained in:
parent
241dcc5b6c
commit
1f4035f0dd
@ -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'] = intval($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'] = intval($item['unit_price']) * 100;
|
||||
$item['unit_price'] = intval($item['unit_price'] * 100) ;
|
||||
}
|
||||
|
||||
$this->types = array_pluck($orderItems, 'type', 'order_sn');
|
||||
|
@ -109,9 +109,9 @@ class OrderBaseSync extends Command
|
||||
'package_id' => $this->packages[$item['o_p_number']]['id'] ?? 0,
|
||||
'transaction_no' => '',
|
||||
'pay_channel' => 'bank',
|
||||
'unit_price' => floatval($item['o_price']) * 100,
|
||||
'unit_price' => intval($item['o_price'] * 100),
|
||||
'counts' => $item['o_card_counts'],
|
||||
'total_price' => floatval($item['o_amount']) * 100,
|
||||
'total_price' => intval($item['o_amount'] * 100),
|
||||
'order_at' => Carbon::parse($item['o_create_date'])->format('Y-m-d H:i:s'),
|
||||
'address' => $item['o_address'],
|
||||
'contacts' => $item['o_contacts'],
|
||||
|
@ -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'] = intval($package['cost_price']) * 100;
|
||||
$package['guide_price'] = intval($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 = intval($value['sale_account']) * 100;
|
||||
$custom_price = intval($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']];
|
||||
|
@ -47,8 +47,8 @@ class PackageSync extends Command
|
||||
'name' => $item->name,
|
||||
'type' => 0,
|
||||
'carrier_operator' => self::$carrier_operator[$item->carrieroperator],
|
||||
'cost_price' => $item->price * 100,
|
||||
'guide_price' => intval($item->package_rp) * 100,
|
||||
'cost_price' => intval($item->price * 100),
|
||||
'guide_price' => intval($item->package_rp * 100),
|
||||
'flows' => ($item->tag == 10) ? intval($item->package_value) : 0,
|
||||
'voices' => ($item->tag == 11) ? intval($item->package_value) : 0,
|
||||
'messages' => 0,
|
||||
@ -78,8 +78,8 @@ class PackageSync extends Command
|
||||
'name' => $item->package_name,
|
||||
'type' => 1,
|
||||
'carrier_operator' => self::$carrier_operator[$item->operator],
|
||||
'cost_price' => floatval($item->price) * 100,
|
||||
'guide_price' => floatval($item->guide_price) * 100,
|
||||
'cost_price' => intval($item->price * 100),
|
||||
'guide_price' => intval($item->guide_price * 100),
|
||||
'flows' => empty($item->flows) ? 0 : $item->flows,
|
||||
'voices' => empty($item->voice_num) ? 0 : $item->voice_num,
|
||||
'messages' => empty($item->sms_num) ? 0 : $item->sms_num,
|
||||
@ -109,8 +109,8 @@ class PackageSync extends Command
|
||||
'name' => $item->package_name,
|
||||
'type' => 2,
|
||||
'carrier_operator' => self::$carrier_operator[$item->operator],
|
||||
'cost_price' => floatval($item->price) * 100,
|
||||
'guide_price' => floatval($item->guide_price) * 100,
|
||||
'cost_price' => intval($item->price * 100),
|
||||
'guide_price' => intval($item->guide_price * 100),
|
||||
'flows' => empty($item->flows) ? 0 : $item->flows,
|
||||
'voices' => empty($item->voice_num) ? 0 : $item->voice_num,
|
||||
'messages' => empty($item->sms_num) ? 0 : $item->sms_num,
|
||||
|
@ -33,7 +33,7 @@ class ProductSync extends Command
|
||||
throw new \Exception('套餐不存在');
|
||||
}
|
||||
|
||||
$base_price = intval($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'] = 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;
|
||||
$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'] = intval($attributes['base_price']) * 100;
|
||||
$attributes['renewal_price'] = intval($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'],
|
||||
|
@ -52,7 +52,6 @@
|
||||
|
||||
<div class="page-list-wrap">
|
||||
<Table :columns="columns" :data="data" :height="page.limit > 12 ? 610 : ''" ref="table" stripe>
|
||||
|
||||
<template class="table-footer" slot="footer">
|
||||
<colgroup class="table-footer-colgroup"></colgroup>
|
||||
<thead class="ivu-table">
|
||||
|
@ -105,21 +105,21 @@
|
||||
<li class="ui-list">
|
||||
<div class="ui-list-title">套餐成本价:</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.01" v-model="params.cost_price"></InputNumber> 元
|
||||
<InputNumber :active-change="false" :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.01" v-model="params.cost_price"></InputNumber> 元
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="ui-list">
|
||||
<div class="ui-list-title">套餐指导价:</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.01" v-model="params.guide_price"></InputNumber> 元
|
||||
<InputNumber :active-change="false" :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.01" v-model="params.guide_price"></InputNumber> 元
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="ui-list">
|
||||
<div class="ui-list-title">续费成本价:</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.01" v-model="params.renewal_cost_price"></InputNumber> 元
|
||||
<InputNumber :active-change="false" :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.01" v-model="params.renewal_cost_price"></InputNumber> 元
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
<span class="title-require">*</span>选择套餐:
|
||||
</div>
|
||||
<div class="ui-list-content">
|
||||
<Select filterable v-model.trim="params.package_id" :disabled="isUpdate">
|
||||
<Select :disabled="isUpdate" filterable v-model.trim="params.package_id">
|
||||
<Option :key="item.id" :value="item.id" v-for="item in completePackages">{{ item.name }}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
@ -27,14 +27,14 @@
|
||||
<li class="ui-list">
|
||||
<div class="ui-list-title">基础价格</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.1" v-model.trim="params.base_price"></InputNumber>
|
||||
<InputNumber :active-change="false" :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.1" v-model.trim="params.base_price"></InputNumber>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="ui-list">
|
||||
<div class="ui-list-title">续费价格</div>
|
||||
<div class="ui-list-content">
|
||||
<InputNumber :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.1" v-model.trim="params.renewal_price"></InputNumber>
|
||||
<InputNumber :active-change="false" :formatter="value => Number(value).toFixed(2)" :max="100000" :min="0" :step="0.1" v-model.trim="params.renewal_price"></InputNumber>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user