convert recieptpdf

This commit is contained in:
Russ Long 2018-12-29 14:09:40 -05:00
parent f986fbf937
commit 57f392ef3f
3 changed files with 22 additions and 13 deletions

View File

@ -216,9 +216,16 @@ class PagesController extends Controller
$checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid) $checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid)
->first(); ->first();
$bidder_num = $checkout_final_results->bidder_num; $bidder_num = $checkout_final_results->bidder_num;
$checkout_list_results = WinningBids::with('items_rel') $checkout_list_results = DB::select("SELECT
->where('winning_bidder_num', '=', $bidder_num) *, items.item_assigned_num, items.item_desc
->get(); FROM winning_bids
INNER JOIN items AS items
ON winning_bids.winning_item_num=items.iditems
WHERE winning_bidder_num = $bidder_num
");
WinningBids::with('items')
->where('winning_bidder_num', '=', '$bidder_num')
->get();
$checkout_info_results = DB::select("SELECT $checkout_info_results = DB::select("SELECT
winning_bids.*, winning_bids.*,
bidders.*, bidders.*,

View File

@ -20,7 +20,7 @@ class WinningBids extends Model
'updated_at' 'updated_at'
]; ];
public function items_rel() public function items()
{ {
return $this->hasMany('App\Models\Items', 'iditems', 'winning_item_num'); return $this->hasMany('App\Models\Items', 'iditems', 'winning_item_num');
} }

View File

@ -84,10 +84,10 @@
@foreach($checkout_list_results as $checkout_list_result) @foreach($checkout_list_results as $checkout_list_result)
<tr> <tr>
<td> <td>
{{ $checkout_list_result->items_rel->first()->item_assigned_num }} {{ $checkout_list_result->item_assigned_num }}
</td> </td>
<td> <td>
{{ $checkout_list_result->items_rel->first()->item_desc }} {{ $checkout_list_result->item_desc }}
</td> </td>
<td> <td>
${{ $checkout_list_result->winning_cost }} ${{ $checkout_list_result->winning_cost }}
@ -108,19 +108,21 @@
</h4> </h4>
</th> </th>
<th> <th>
@if($checkout_final_results->payment_method==1) @foreach($checkout_final_results as $checkout_final_result)
@if($checkout_final_result->payment_method==1)
<h4> <h4>
CASH CASH
</h4> </h4>
@elseif($checkout_final_results->payment_method==2) @elseif($checkout_final_result->payment_method==2)
<h4> <h4>
CHECK Number {{ $checkout_final_results->check_number }} CHECK Number {{ $checkout_final_result->check_number }}
</h4> </h4>
@else @else
<h4> <h4>
CREDIT {{ $checkout_final_results->cc_transaction }} CREDIT {{ $checkout_final_result->cc_transaction }}
</h4> </h4>
@endif @endif
@endforeach
</th> </th>
</tr> </tr>
</table> </table>
@ -179,13 +181,13 @@
@foreach($checkout_list_results as $checkout_list_result) @foreach($checkout_list_results as $checkout_list_result)
<tr> <tr>
<td> <td>
{{ $checkout_list_result->items_rel->first()->item_assigned_num }} {{ $checkout_list_result->item_assigned_num }}
</td> </td>
<td> <td>
{{ $checkout_list_result->items_rel->first()->item_desc }} {{ $checkout_list_result->item_desc }}
</td> </td>
<td> <td>
${{ $checkout_list_result->items->winning_cost }} ${{ $checkout_list_result->winning_cost }}
</td> </td>
<td> <td>
</td> </td>