first commit

This commit is contained in:
root
2026-01-10 16:16:39 +03:00
commit 5f5a28e292
154 changed files with 21454 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class OrganizationModel extends Model
{
protected $table = 'organizations';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = true; // Включаем мягкое удаление (deleted_at)
protected $allowedFields = ['owner_id', 'name', 'type', 'logo', 'requisites', 'trial_ends_at', 'settings'];
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Получить организации конкретного пользователя
public function getUserOrganizations(int $userId)
{
// TODO: Здесь мы будем делать JOIN с таблицей organization_users
// Пока упрощенная версия для владельца
return $this->where('owner_id', $userId)->findAll();
}
}