2018-12-23 09:00:22 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class WinningBids extends Model
|
|
|
|
{
|
2018-12-23 10:26:26 -05:00
|
|
|
protected $table = 'winning_bids';
|
|
|
|
protected $fillable = [
|
2018-12-23 09:00:22 -05:00
|
|
|
'winning_bidder_num',
|
|
|
|
'winning_cost',
|
2018-12-23 10:17:10 -05:00
|
|
|
'winning_item_num',
|
|
|
|
'created_at',
|
|
|
|
'updated_at'
|
2018-12-23 10:26:26 -05:00
|
|
|
];
|
2018-12-23 10:17:10 -05:00
|
|
|
|
2018-12-23 10:26:26 -05:00
|
|
|
protected $dates = [
|
2018-12-23 10:17:10 -05:00
|
|
|
'created_at',
|
|
|
|
'updated_at'
|
2018-12-23 10:26:26 -05:00
|
|
|
];
|
2018-12-23 09:00:22 -05:00
|
|
|
|
2018-12-29 14:09:40 -05:00
|
|
|
public function items()
|
2018-12-23 10:26:26 -05:00
|
|
|
{
|
2022-08-08 15:01:38 -04:00
|
|
|
return $this->hasMany(Items::class, 'iditems', 'winning_item_num');
|
2018-12-23 10:26:26 -05:00
|
|
|
}
|
2018-12-23 09:00:22 -05:00
|
|
|
|
2018-12-23 10:26:26 -05:00
|
|
|
public function bidders()
|
|
|
|
{
|
2022-08-08 15:01:38 -04:00
|
|
|
return $this->belongsTo(Bidders::class, 'winning_bidder_num', 'idbidders');
|
2018-12-23 10:26:26 -05:00
|
|
|
}
|
2018-12-23 09:00:22 -05:00
|
|
|
}
|