2025-04-28 16:15:09 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2025-04-28 16:45:23 +08:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
2025-04-28 16:15:09 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 项目标签关联表
|
|
|
|
|
*/
|
|
|
|
|
class ProjectLabelRelationModal extends Model
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
protected $table = 'project_label_relations';
|
|
|
|
|
|
|
|
|
|
protected $guarded = [];
|
2025-04-28 16:45:23 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 项目
|
|
|
|
|
* @return HasOne
|
|
|
|
|
*/
|
|
|
|
|
public function project(): HasOne
|
|
|
|
|
{
|
|
|
|
|
return $this->hasOne(ProjectModal::class, 'id', 'project_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 标签
|
|
|
|
|
* @return HasOne
|
|
|
|
|
*/
|
|
|
|
|
public function label(): HasOne
|
|
|
|
|
{
|
|
|
|
|
return $this->hasOne(LabelModal::class, 'id', 'label_id');
|
|
|
|
|
}
|
2025-04-28 16:15:09 +08:00
|
|
|
}
|