This commit is contained in:
Your Name
2026-09-01 10:42:16 +08:00
parent 456dd667df
commit 5bd5eae62d
358 changed files with 2276 additions and 495 deletions
@@ -6,6 +6,7 @@ namespace app\adminapi\logic\firstvisit;
use app\common\service\DataScope\DataScopeService;
use app\common\service\qywx\QywxCustomerAcquisitionCustomerService;
use app\common\service\qywx\QywxPromotionOperatorAccess;
use RuntimeException;
use think\facade\Db;
@@ -23,7 +24,7 @@ class WecomAcquisitionCustomerLogic
self::applyScope(
$query,
'l',
DataScopeService::getVisibleAdminIds($adminId, $adminInfo),
QywxPromotionOperatorAccess::visibleAdminIds($adminId, $adminInfo),
self::operatorPoolIds($adminId)
);
if ($localLinkId > 0) {
@@ -60,7 +61,8 @@ class WecomAcquisitionCustomerLogic
{
$page = max(1, (int) ($params['page_no'] ?? $params['page'] ?? 1));
$pageSize = min(100, max(1, (int) ($params['page_size'] ?? 20)));
$visibleIds = DataScopeService::getVisibleAdminIds($adminId, $adminInfo);
$hasBasePagePermission = QywxPromotionOperatorAccess::hasBasePagePermission($adminId, $adminInfo);
$visibleIds = QywxPromotionOperatorAccess::visibleAdminIds($adminId, $adminInfo);
$operatorPoolIds = self::operatorPoolIds($adminId);
$base = self::customerQuery($params, $visibleIds, $operatorPoolIds);
$total = (int) (clone $base)->count();
@@ -87,7 +89,9 @@ class WecomAcquisitionCustomerLogic
return [
'meta' => [
'scope_label' => DataScopeService::scopeLabel(DataScopeService::getEffectiveScope($adminInfo)),
'scope_label' => $hasBasePagePermission
? DataScopeService::scopeLabel(DataScopeService::getEffectiveScope($adminInfo))
: '仅共享方案',
'generated_at' => date('Y-m-d H:i:s'),
],
'summary' => [
@@ -188,18 +192,7 @@ class WecomAcquisitionCustomerLogic
/** @return list<int> */
private static function operatorPoolIds(int $adminId): array
{
if ($adminId <= 0) {
return [];
}
$ids = Db::name('qywx_promotion_pool_operator')
->where('admin_id', $adminId)
->whereNull('delete_time')
->column('pool_id');
return array_values(array_unique(array_filter(array_map(
static fn ($value): int => (int) $value,
$ids
), static fn (int $value): bool => $value > 0)));
return QywxPromotionOperatorAccess::activePoolIds($adminId);
}
private static function maskIdentifier(string $value): string