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