arrays - 是否可以在laravel中的Array ['在此处添加变量']中分配变量
问题描述
是否可以在数组 [' $addhere '] 内分配一个变量?我在变量中分配了一个值,我想把它放在 []
这是变量
@php
$order_id=$orderItem->id;
@endphp
我想把它放在这里,
{{$partialDeliveries[$order_id]->stock_in_qty}}
错误响应
刀片中的表
<table class="table table-striped m-b-none" id="orders" >
<thead>
<tr>
<th width="">Product Code</th>
<th>Product Name</th>
<th>Quantity</th>
<th>Delivery Date</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
@foreach($order->orderItems as $orderItem)
@php
$order_id=$orderItem->id;
@endphp
<tr>
<td>{{ $orderItem->product_code }} {{$order_id}}</td>
<td>{{ $orderItem->product_name }} {{$partialDeliveries[$order_id]->stock_in_qty}}</td>
{{-- <td> {{$orderItem->quantity}}</td> --}}
<td><input type="number" name="stock_in_qty[]" id="stock_in_qty_{{$orderItem->id}}" class="form-control stock_in_qty" min="1" value="{{$orderItem->quantity}}" data-max="{{$orderItem->quantity}}" onkeyup="check(this);"/></td>
<script type="text/javascript">
var $orderItem_id = {{$orderItem->id}};
$('#stock_in_qty_'+$orderItem_id).on('mouseup keyup', function () {
$(this).val(Math.min({{$orderItem->quantity}}, Math.max(1, $(this).val())));
});
</script>
<td> {{ Form::date('delivery_date[]',today(), ['class' => 'form-control date', 'style' => 'width:200px;','required']) }}</td>
<td>{!! Form::text('delivery_note[]', null, ['class'=>'form-control']) !!}
@if ($errors->has('delivery_note'))<span class="help-block"><strong>{{ $errors->first('delivery_note') }}</strong></span>@endif
</td>
</tr>
{!! Form::hidden('product_id[]', $orderItem->product_id) !!}
{!! Form::hidden('stock_in_qty[]', $orderItem->quantity) !!}
{!! Form::hidden('order_id[]', $order->id) !!}
{!! Form::hidden('order_item_id[]', $orderItem->id ) !!}
{!! Form::hidden('company_id[]', $order->company->id) !!}
{!! Form::hidden('stock_out_qty[]',null) !!}
{!! Form::hidden('transfer_to[]', null) !!}
{!! Form::hidden('user_id[]',auth()->user()->id ) !!}
@endforeach
</tbody>
</table>
解决方案
推荐阅读
- c# - Ironpython 导致 Xamarin.Android 应用程序编译失败
- regex - Woocommerce 永久链接 substr 替换
- excel - 使用 Target.Address 引用范围
- python - 交换唯一值时如何避免唯一性约束上的 SQLAlchemy IntegrityError
- c# - MongoDB LINQ 包含任何不支持的过滤器
- ios - 如何预构建 React Native pod,或者,有没有办法在 Podfile 中使用远程 React Native pod?
- regex - 正则表达式延迟匹配
- erlang - Elixir CRC 无法在 MAC 操作系统上编译
- c# - 如何在我的 xamarin.forms 应用程序中使用 FluentValidaiton 将错误消息分配给良好的文本标签
- java - 在 JButton 单击和调用逻辑上打开新的 JPane 未按预期工作