@if ($peripheral->type == 'range')
@php
$info = explode('/', $peripheral->name);
$unit = (isset($info[1])) ? '每'.$info[1] : '';
$ranges = json_decode($peripheral->setting, true);
@endphp
| {{$info[0]}} |
@foreach ($ranges as $range)
@if (count($ranges) > 1){{$range['min']}}~{{$range['max']}}:@endif {{$unit.$range['fee']}}/天
@endforeach
|
@else
{{$peripheral->name}} |
{{$peripheral->fee}}/{{config('site.charge_types')[$peripheral->type]}} |
@endif
@foreach ($dates as $date)
@php
$field = 'peripheral.'.$peripheral->id.'.'.$date;
@endphp
@if ($peripheral->type == 'time')
id])) == '1') checked @endif>
|
@break
@else
@switch($peripheral->type)
@case('period')
@php
$values = [];
if (isset($rentPeripherals[$peripheral->id]['data'][$date])) {
$values = $rentPeripherals[$peripheral->id]['data'][$date]['values'];
}
@endphp
@foreach (config('rent.rent_period') as $key => $text)
@endforeach
@break
@case('range')
@case('bout')
@case('day-num')
@php
$value = null;
if (isset($rentPeripherals[$peripheral->id]['data'][$date])) {
$value = $rentPeripherals[$peripheral->id]['data'][$date]['value'];
}
@endphp
@if (($peripheral->type == 'range' && count($ranges) == 1) || $peripheral->type == 'bout')
@php
$min = 1;
$max = 5;
if ($peripheral->type == 'range') {
$min = $ranges[0]['min'];
$max = $ranges[0]['max'];
}
@endphp
@else
@endif
@break
@case('day')
@php
$values = [];
if (isset($rentPeripherals[$peripheral->id]['data'])) {
$values = $rentPeripherals[$peripheral->id]['data'];
}
@endphp
@break
@case('hour')
@php
$sValues = old($field.'.s', []);
$eValues = old($field.'.e', []);
if (empty($sValues) && isset($rentPeripherals[$peripheral->id]['data'][$date])) {
$values = $rentPeripherals[$peripheral->id]['data'][$date]['values'];
foreach ($values as $i => $value) {
list($sValues[$i], $eValues[$i]) = explode('~', $value);
}
}
@endphp
@foreach ($sValues as $key => $value)
~
@endforeach
@break
@endswitch
|
@endif
@endforeach
@endforeach