修复:运费计算错误

修复:管理后台添加商品时没有默认选中第一个计量单位
This commit is contained in:
wuhui_zzw 2023-10-11 09:54:01 +08:00
parent 61129e6971
commit 71f1c85492
2 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@ class ShippingService{
$amount += (float)sprintf("%.2f",$firstWeightFee);
// 判断:如果总重量超过首重 则计算续重运费
$surplus = (float)$sumWeight - $firstWeight;
if($surplus > 0) $amount += (float)sprintf("%.2f",($surplus / $addWeight) * $continuationWeightFee);
if($surplus > 0) $amount += (float)sprintf("%.2f",(ceil($surplus / $addWeight)) * $continuationWeightFee);
}
return $amount;

View File

@ -179,7 +179,7 @@
<x-admin::form.row :title="__('product.unit_of_measurement')" required>
<select class="form-select me-3" name="unit" v-model="form.unit">
@foreach ($unit_list as $option)
<option value="{{ $option['title'] }}" {{ $option['title'] == $product->unit ? 'selected': '' }}>{{ $option['title'] }}</option>
<option value="{{ $option['title'] }}" {{ $option['title'] == old('unit', $product->unit ?? '') ? 'selected': '' }}>{{ $option['title'] }}</option>
@endforeach
</select>
</x-admin::form.row>
@ -871,7 +871,7 @@
minimum_order: {{$product->minimum_order ?? 0}},
sales_method: '{{$product->sales_method ?? 'piece'}}',
piece_to_batch: {{$product->piece_to_batch ?? 1}},
unit: '{{$product->unit ?? ''}}',
unit: '{{ $product->unit ? : 'Acre/Acres' }}',
},
variablesBatch: {