🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 02:16

This commit is contained in:
Hamza-Ayed
2026-05-03 02:16:47 +03:00
parent adb262c6b8
commit 355fb45935
4 changed files with 31 additions and 8 deletions

View File

@@ -10,6 +10,13 @@ final class InvoiceModel extends BaseModel
{
protected string $table = 'invoices';
public function findByTenant(string $tenantId): array
{
$stmt = $this->db()->prepare("SELECT * FROM {$this->table} WHERE tenant_id = ? AND deleted_at IS NULL ORDER BY created_at DESC");
$stmt->execute([$tenantId]);
return $stmt->fetchAll();
}
public function findByStatus(string $status, ?string $tenantId = null): array
{
$sql = "SELECT * FROM {$this->table} WHERE status = ? AND deleted_at IS NULL";