41 lines
883 B
PHP
41 lines
883 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PriceSyncLogItem extends Model
|
|
{
|
|
protected $table = 'price_sync_log_items';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'log_id',
|
|
'product_id',
|
|
'product_title',
|
|
'reading_method',
|
|
'source_name',
|
|
'base_price',
|
|
'base_profit',
|
|
'offset_percent',
|
|
'stored_price',
|
|
'previous_price',
|
|
];
|
|
|
|
protected $casts = [
|
|
'product_id' => 'integer',
|
|
'base_price' => 'integer',
|
|
'base_profit' => 'integer',
|
|
'offset_percent' => 'float',
|
|
'stored_price' => 'integer',
|
|
'previous_price' => 'integer',
|
|
];
|
|
|
|
public function log(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PriceSyncLog::class, 'log_id');
|
|
}
|
|
}
|