【发布时间】:2017-02-07 13:32:37
【问题描述】:
在我看来,我该如何做到这一点: $tva = $order->OrderLine->Model->Product->Tva->value ?
@foreach ($orders as $order)
<tr>
<td>{{$order->id}}</td>
<td>{{$order->statut}}</td>
<td>{{Carbon\Carbon::parse($order->created_at)->format('d-m-Y h:i:s')}}</td>
<?php $prixHT=0 ?>
@foreach ($order->OrderLine as $line)
<?php $priceHT += ($line->model->priceHT * $line->quantite) ?>
@endforeach
<!-- $tva = $order->OrderLine->Model->Product->Tva->value -->
<td>{{$prixHT * ($tva/100)}}</td>
[orders] 1,n ( ) 1,1 [order_lines] 1,1 ( ) 1,n [models] 1,1 ( ) 1,n [products] 1,1 ( ) 0,n [tvas]
【问题讨论】:
标签: laravel eloquent attributes blade