Initial commit
This commit is contained in:
116
app/Models/Log.php
Normal file
116
app/Models/Log.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use App\Models\PowerCategory;
|
||||
|
||||
class Log extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'logs';
|
||||
|
||||
protected $fillable = [
|
||||
'round_id',
|
||||
'file_id',
|
||||
'accepted',
|
||||
'processed',
|
||||
'ip_address',
|
||||
|
||||
'tname',
|
||||
'tdate',
|
||||
'pcall',
|
||||
'pwwlo',
|
||||
'pexch',
|
||||
'psect',
|
||||
'pband',
|
||||
'pclub',
|
||||
'padr1',
|
||||
'padr2',
|
||||
|
||||
'rname',
|
||||
'rcall',
|
||||
'rcoun',
|
||||
'locator',
|
||||
'radr1',
|
||||
'radr2',
|
||||
'rpoco',
|
||||
'rcity',
|
||||
'rphon',
|
||||
'rhbbs',
|
||||
'mope1',
|
||||
'mope2',
|
||||
'stxeq',
|
||||
'srxeq',
|
||||
'sante',
|
||||
'santh',
|
||||
|
||||
'power_watt',
|
||||
'power_category',
|
||||
'power_category_id',
|
||||
'sixhr_category',
|
||||
|
||||
'claimed_qso_count',
|
||||
'claimed_score',
|
||||
'claimed_wwl',
|
||||
'claimed_dxcc',
|
||||
'cqsos',
|
||||
'cqsop',
|
||||
'cwwls',
|
||||
'cwwlb',
|
||||
'cexcs',
|
||||
'cexcb',
|
||||
'cdxcs',
|
||||
'cdxcb',
|
||||
'ctosc',
|
||||
'codxc',
|
||||
|
||||
'remarks',
|
||||
'remarks_eval',
|
||||
'raw_header',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'round_id' => 'integer',
|
||||
'file_id' => 'integer',
|
||||
|
||||
'accepted' => 'boolean',
|
||||
'processed' => 'boolean',
|
||||
|
||||
'power_watt' => 'float',
|
||||
'power_category_id' => 'integer',
|
||||
'sixhr_category' => 'boolean',
|
||||
|
||||
'claimed_qso_count' => 'integer',
|
||||
'claimed_score' => 'integer',
|
||||
];
|
||||
|
||||
public function round(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Round::class);
|
||||
}
|
||||
|
||||
public function file(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
|
||||
public function qsos(): HasMany
|
||||
{
|
||||
return $this->hasMany(LogQso::class);
|
||||
}
|
||||
|
||||
public function logResults(): HasMany
|
||||
{
|
||||
return $this->hasMany(LogResult::class);
|
||||
}
|
||||
|
||||
public function powerCategory(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PowerCategory::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user