35 lines
765 B
PHP
35 lines
765 B
PHP
<?php
|
|
|
|
namespace Modules\BiddingManagement\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class BidCriteria extends Model
|
|
{
|
|
protected $table = 'bid_criteria';
|
|
|
|
protected $fillable = [
|
|
'bid_package_id', 'name', 'weight', 'description', 'sort_order',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'weight' => 'decimal:2',
|
|
'sort_order' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function package(): BelongsTo
|
|
{
|
|
return $this->belongsTo(BidPackage::class, 'bid_package_id');
|
|
}
|
|
|
|
public function scores(): HasMany
|
|
{
|
|
return $this->hasMany(BidScore::class);
|
|
}
|
|
}
|