Update: 2026-05-12 01:19:04
This commit is contained in:
@@ -27,14 +27,14 @@ $db = Database::getInstance();
|
|||||||
|
|
||||||
// 1. Get batch info
|
// 1. Get batch info
|
||||||
$stmt = $db->prepare("
|
$stmt = $db->prepare("
|
||||||
SELECT id, status, total_images, processed_images, failed_images, created_at, completed_at
|
SELECT id, tenant_id, status, total_images, processed_images, failed_images, created_at, completed_at
|
||||||
FROM invoice_batches
|
FROM invoice_batches
|
||||||
WHERE id = ? AND tenant_id = ?
|
WHERE id = ?
|
||||||
");
|
");
|
||||||
$stmt->execute([$batchId, $tenantId]);
|
$stmt->execute([$batchId]);
|
||||||
$batch = $stmt->fetch();
|
$batch = $stmt->fetch();
|
||||||
|
|
||||||
if (!$batch) {
|
if (!$batch || ($decoded['role'] !== 'super_admin' && $batch['tenant_id'] !== $tenantId)) {
|
||||||
json_error('الدفعة غير موجودة', 404);
|
json_error('الدفعة غير موجودة', 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user