deploy: auto commit repo-root changes 2026-06-13 00:17:26
This commit is contained in:
@@ -9,6 +9,21 @@ use think\facade\Db;
|
||||
|
||||
class CommentAccountLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
protected const PERSONA_LABELS = [
|
||||
'数据派',
|
||||
'老球迷',
|
||||
'教练视角',
|
||||
'夜班编辑',
|
||||
'伤停控',
|
||||
'赔率派',
|
||||
'更衣室派',
|
||||
'球探派',
|
||||
'解说腔',
|
||||
'主队党',
|
||||
'模型党',
|
||||
'资讯控',
|
||||
];
|
||||
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [];
|
||||
@@ -61,7 +76,7 @@ class CommentAccountLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
}
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['persona_label'] = $this->resolvePersonaLabel((string) $item['nickname']);
|
||||
$item['persona_label'] = $this->resolvePersonaLabel((string) $item['account'], (string) $item['nickname']);
|
||||
$item['article_comment_count'] = $articleCounts[(int) $item['id']] ?? 0;
|
||||
$item['community_comment_count'] = $communityCounts[(int) $item['id']] ?? 0;
|
||||
$item['total_comment_count'] = $item['article_comment_count'] + $item['community_comment_count'];
|
||||
@@ -85,12 +100,16 @@ class CommentAccountLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
return $query->count();
|
||||
}
|
||||
|
||||
protected function resolvePersonaLabel(string $nickname): string
|
||||
protected function resolvePersonaLabel(string $account, string $nickname): string
|
||||
{
|
||||
if (str_contains($nickname, '·')) {
|
||||
$parts = explode('·', $nickname, 2);
|
||||
return $parts[1] ?: '-';
|
||||
}
|
||||
if (preg_match('/(\d+)$/', $account, $matches)) {
|
||||
$index = max(1, (int) $matches[1]);
|
||||
return self::PERSONA_LABELS[($index - 1) % count(self::PERSONA_LABELS)] ?? '-';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user