lcly-data-admin/app/Models/RiceShrimpWeeklyPrice.php

33 lines
693 B
PHP

<?php
namespace App\Models;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Peidikeji\Keywords\Models\Keywords;
class RiceShrimpWeeklyPrice extends Model
{
use Filterable, HasFactory;
protected $fillable = [
'year', 'week', 'price', 'created_by', 'updated_by',
];
public function weekObj()
{
return $this->belongsTo(Keywords::class, 'week');
}
public function createdBy()
{
return $this->belongsTo(AdminUser::class, 'created_by');
}
public function updatedBy()
{
return $this->belongsTo(AdminUser::class, 'updated_by');
}
}