Update ConversionLogic.php

This commit is contained in:
2026-05-04 17:37:14 +08:00
parent 28fbbd28b7
commit 1d6a2b9cbf
@@ -319,9 +319,12 @@ class ConversionLogic
->whereNull('a.delete_time');
if ($visibleAdminIds !== null) {
if ($visibleAdminIds === []) {
return [];
// 与 HasDataScopeFilter::applyDataScopeByOwner 对齐:空集合用 0=1 闸门让 SQL 自然返回空,
// 避免和"未传 visibleAdminIds (=SCOPE_ALL)"在调用侧产生混淆。
$query->whereRaw('0 = 1');
} else {
$query->whereIn('a.id', $visibleAdminIds);
}
$query->whereIn('a.id', $visibleAdminIds);
}
return $query
@@ -575,9 +578,11 @@ class ConversionLogic
}
if ($visibleAdminIds !== null) {
if ($visibleAdminIds === []) {
return [];
// 与 HasDataScopeFilter::applyDataScopeByOwner 对齐:空集合用 0=1 闸门让 SQL 自然返回空。
$query->whereRaw('0 = 1');
} else {
$query->whereIn('a.id', $visibleAdminIds);
}
$query->whereIn('a.id', $visibleAdminIds);
}
$rows = $query->order('a.id asc')->select()->toArray();
@@ -1798,9 +1803,11 @@ class ConversionLogic
if ($visibleAdminIds !== null) {
if ($visibleAdminIds === []) {
return [];
// 与 HasDataScopeFilter::applyDataScopeByOwner 对齐:空集合用 0=1 闸门让 SQL 自然返回空。
$query->whereRaw('0 = 1');
} else {
$query->whereIn('a.id', $visibleAdminIds);
}
$query->whereIn('a.id', $visibleAdminIds);
}
if ($mediaChannel !== null) {