Исправлены модели, контроллеры и маршруты для AI-сборки

This commit is contained in:
dimon8
2026-01-12 08:04:42 +00:00
parent 2d98209ce1
commit e7b63f7863
8 changed files with 1 additions and 169 deletions

View File

@@ -10,7 +10,6 @@ class AiTask extends Model
use HasFactory;
protected $fillable = [
<<<<<<< HEAD
'title',
'description',
'ai_prompt_template',
@@ -24,35 +23,4 @@ class AiTask extends Model
'budget_max' => 'decimal:2',
'is_active' => 'boolean'
];
=======
'user_id',
'name',
'prompt_template',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
// Связь с пользователем (если шаблон пользовательский)
public function user()
{
return $this->belongsTo(User::class);
}
// Общие (глобальные) шаблоны — где user_id IS NULL
public function scopeGlobal($query)
{
return $query->whereNull('user_id');
}
// Активные шаблоны
public function scopeActive($query)
{
return $query->where('is_active', true);
}
>>>>>>> origin/main
}

View File

@@ -18,7 +18,6 @@ class PcBuild extends Model
];
<<<<<<< HEAD
// 👇 Связь "многие-ко-многим" с компонентами
public function components()
{
@@ -26,20 +25,10 @@ class PcBuild extends Model
}
// Обратная связь
=======
protected $casts = [
'is_ai_generated' => 'boolean',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
// Связь с пользователем
>>>>>>> origin/main
public function user()
{
return $this->belongsTo(User::class);
}
<<<<<<< HEAD
// Опционально: защита от ошибок, если сборка без пользователя
protected static function booted()
@@ -50,6 +39,4 @@ class PcBuild extends Model
}
});
}
=======
>>>>>>> origin/main
}