38 lines
979 B
PHP
38 lines
979 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class EquipmentWorkHistory extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $table = 'equipment_work_historys';
|
|
|
|
protected $primaryKey = 'equipmentWorkHistorys_id';
|
|
|
|
public function equipment()
|
|
{
|
|
return $this->belongsTo(Equipment::class, 'equipment_id', 'equipment_id');
|
|
}
|
|
public function companyProject()
|
|
{
|
|
return $this->belongsTo(CompanyProject::class, 'company_projects_id', 'company_projects_id');
|
|
}
|
|
|
|
public function controlEquipmentWorkstation()
|
|
{
|
|
return $this->hasMany(ControlEquipmentWorkstation::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
|
|
}
|
|
|
|
public function equipmentAssociationAmbit()
|
|
{
|
|
return $this->hasOne(EquipmentAssociationAmbit::class, 'equipmentWorkHistorys_id', 'equipmentWorkHistorys_id');
|
|
}
|
|
|
|
}
|