Convert helpers

This commit is contained in:
Russ Long 2018-12-23 09:22:52 -05:00
parent dd6fcc95cc
commit 6e618d048a
2 changed files with 2 additions and 5 deletions

View File

@ -18,7 +18,7 @@ class Checkout extends Model
public function bidders() public function bidders()
{ {
return $this->belongsTo('App\Models\Bidders', 'bidder_num', 'idbidders'); return $this->belongsTo('App\Models\Bidders', 'bidder_num', 'idbidders')->orderBy('bidder_assigned_number', 'asc');
} }
public function paymentMethod() public function paymentMethod()

View File

@ -25,11 +25,8 @@ class CheckoutBidderSelectList
{ {
public static function CheckoutBidderShowNumbers() public static function CheckoutBidderShowNumbers()
{ {
$checkout_bidder_num_results = Checkout::with(['bidders' => function ($q) { $checkout_bidder_num_results = Checkout::with('bidders')
$q->orderBy('bidder_assigned_number', 'asc');
}])
->get(); ->get();
dd($checkout_bidder_num_results);
$checkout_bidder_num = '<option disabled selected hidden value="">choose...</option>'; $checkout_bidder_num = '<option disabled selected hidden value="">choose...</option>';
foreach($checkout_bidder_num_results as $checkout_bidder_num_result){ foreach($checkout_bidder_num_results as $checkout_bidder_num_result){
$checkout_bidder_num .= '<option value="' . $checkout_bidder_num_result->bidders->idbidders . '">' . $checkout_bidder_num_result->bidders->bidder_assigned_number . ' - ' . $checkout_bidder_num_result->bidders->bidder_fname . ' ' . $checkout_bidder_num_result->bidders->bidder_lname .'</option>'; $checkout_bidder_num .= '<option value="' . $checkout_bidder_num_result->bidders->idbidders . '">' . $checkout_bidder_num_result->bidders->bidder_assigned_number . ' - ' . $checkout_bidder_num_result->bidders->bidder_fname . ' ' . $checkout_bidder_num_result->bidders->bidder_lname .'</option>';