Merge remote-tracking branch 'origin/main' into fix/qiuxiang-installation-fee-independent-card
This commit is contained in:
commit
d79a714599
@ -43,6 +43,10 @@ class UpstreamBusinessInformation
|
||||
'financial-risk-control/process-statistics' => $this->shopInfoFlowPage($currentPage, $perPage),
|
||||
default => ['data' => [], 'total' => 0],
|
||||
};
|
||||
request()->attributes->set(
|
||||
'business-page-summary-cards',
|
||||
$this->businessSummaryCards($key, $payload['summary'] ?? []),
|
||||
);
|
||||
|
||||
return new LengthAwarePaginator(
|
||||
array_map(static fn (array $row) => (object) $row, $payload['data']),
|
||||
@ -56,6 +60,97 @@ class UpstreamBusinessInformation
|
||||
);
|
||||
}
|
||||
|
||||
private function businessSummaryCards(string $key, array $summary): array
|
||||
{
|
||||
if ($summary === []) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return match ($key) {
|
||||
'store-management/store-report' => [
|
||||
$this->summaryCard('店铺总数', $summary['stores'] ?? 0, '当前筛选内唯一店铺,明细按期间拆分'),
|
||||
$this->summaryCard('正常店铺', $summary['normal'] ?? 0, '店铺状态为正常(开店中)', ['status' => '0']),
|
||||
$this->summaryCard('关店中', $summary['closing'] ?? 0, '店铺状态为关闭中', ['status' => '3']),
|
||||
$this->summaryCard('已关闭', $summary['closed'] ?? 0, '店铺状态为已关闭', ['status' => '6']),
|
||||
$this->summaryCard('期间销量', $summary['period_sales'] ?? 0, '收入 + 优惠 + 冲减 + 退款', [
|
||||
'sort' => 'period_sales',
|
||||
'direction' => 'desc',
|
||||
], 'money'),
|
||||
],
|
||||
'company-management/subject-operating-report' => [
|
||||
$this->summaryCard('主体总数', $summary['total'] ?? 0, '当前筛选内唯一主体'),
|
||||
($summary['company_status_ready'] ?? false)
|
||||
? $this->summaryCard('有效主体', $summary['normal'] ?? 0, '经营状态为正常', ['company_status' => '正常'])
|
||||
: $this->summaryCard('有效主体', '—', '公司资料镜像未就绪', [], 'text'),
|
||||
($summary['company_status_ready'] ?? false)
|
||||
? $this->summaryCard('已注销主体', $summary['deregistered'] ?? 0, '最新公司资料状态为已注销', ['company_status' => '已注销'])
|
||||
: $this->summaryCard('已注销主体', '—', '公司资料镜像未就绪', [], 'text'),
|
||||
$this->summaryCard('最近12个月收入', $summary['rolling_income'] ?? 0, '最近 12 个完整月账单收入', [
|
||||
'sort' => 'rolling_12m_income',
|
||||
'direction' => 'desc',
|
||||
], 'money'),
|
||||
$this->summaryCard('本月收入', $summary['current_month_income'] ?? 0, (string) ($summary['current_month_label'] ?? '本月') . '账单收入', [
|
||||
'sort' => 'income_' . ($summary['current_month_number'] ?? now()->format('m')),
|
||||
'direction' => 'desc',
|
||||
], 'money'),
|
||||
],
|
||||
'store-management/basic-information' => [
|
||||
$this->summaryCard('店铺总数', $summary['total'] ?? 0, '当前筛选内店铺档案'),
|
||||
$this->summaryCard('正常店铺', $summary['normal'] ?? 0, '店铺状态为正常', ['store_status' => '正常']),
|
||||
$this->summaryCard('关闭中', $summary['closing'] ?? 0, '店铺状态为关闭中', ['store_status' => '关闭中']),
|
||||
$this->summaryCard('已关闭', $summary['closed'] ?? 0, '店铺状态为已关闭', ['store_status' => '已关闭']),
|
||||
$this->summaryCard('平台数', $summary['platforms'] ?? 0, '按店铺档案平台去重', [
|
||||
'sort' => 'platform',
|
||||
'direction' => 'asc',
|
||||
]),
|
||||
],
|
||||
'store-management/store-accounts' => [
|
||||
$this->summaryCard('账号总数', $summary['total'] ?? 0, '当前筛选内账号记录'),
|
||||
$this->summaryCard('主账号', $summary['main_accounts'] ?? 0, '账号类型为 MAIN', ['account_type' => '主账号']),
|
||||
$this->summaryCard('子账号', $summary['sub_accounts'] ?? 0, '账号类型为 SUB', ['account_type' => '子账号']),
|
||||
$this->summaryCard('密码已设置', $summary['password_set'] ?? 0, '仅统计是否设置,不展示密码', ['password_configured' => '已设置']),
|
||||
$this->summaryCard('密码未设置', $summary['password_missing'] ?? 0, '需店铺负责人补充', ['password_configured' => '未设置']),
|
||||
],
|
||||
'company-management/basic-information' => [
|
||||
$this->summaryCard('公司总数', $summary['total'] ?? 0, '当前筛选内公司档案'),
|
||||
$this->summaryCard('正常公司', $summary['normal'] ?? 0, '公司状态为正常', ['company_status' => '正常']),
|
||||
$this->summaryCard('已注销公司', $summary['deregistered'] ?? 0, '公司状态为已注销', ['company_status' => '已注销']),
|
||||
$this->summaryCard('一般纳税人', $summary['general_taxpayer'] ?? 0, '纳税人类型为一般纳税人', ['taxpayer_type' => '一般纳税人']),
|
||||
$this->summaryCard('小规模纳税人', $summary['small_taxpayer'] ?? 0, '纳税人类型为小规模纳税人', ['taxpayer_type' => '小规模纳税人']),
|
||||
],
|
||||
'trademark-management/information' => [
|
||||
$this->summaryCard('商标总数', $summary['total'] ?? 0, '当前筛选内商标档案'),
|
||||
$this->summaryCard('有效商标', $summary['enabled'] ?? 0, '商标状态为有效', ['trademark_status' => '有效']),
|
||||
$this->summaryCard('未启用', $summary['disabled'] ?? 0, '商标状态为未启用', ['trademark_status' => '未启用']),
|
||||
$this->summaryCard('最终持有人', $summary['holders'] ?? 0, '按非空最终持有人去重', [
|
||||
'sort' => 'final_holder',
|
||||
'direction' => 'asc',
|
||||
]),
|
||||
$this->summaryCard('保管部门', $summary['departments'] ?? 0, '按非空保管部门去重', [
|
||||
'sort' => 'custody_department',
|
||||
'direction' => 'asc',
|
||||
]),
|
||||
],
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
||||
private function summaryCard(
|
||||
string $label,
|
||||
mixed $value,
|
||||
string $hint,
|
||||
array $query = [],
|
||||
string $format = 'integer',
|
||||
): array {
|
||||
return [
|
||||
'label' => $label,
|
||||
'value' => $value,
|
||||
'hint' => $hint,
|
||||
'format' => $format,
|
||||
'query' => ['page' => null, ...$query],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 财务经营风险管控 › 流程统计:店铺申请流程(开店 / 变更 / 关店)只读镜像。
|
||||
*
|
||||
@ -227,11 +322,49 @@ SQL);
|
||||
$rows,
|
||||
fn (array $row): bool => $this->storeOwnershipMatchesFilters($row, $filters),
|
||||
));
|
||||
$summary = $this->storeInformationSummary($rows);
|
||||
$this->sortStoreInformation($rows, $filters);
|
||||
$total = count($rows);
|
||||
$offset = ($page - 1) * $perPage;
|
||||
|
||||
return ['data' => array_slice($rows, $offset, $perPage), 'total' => $total];
|
||||
return [
|
||||
'data' => array_slice($rows, $offset, $perPage),
|
||||
'total' => $total,
|
||||
'summary' => $summary,
|
||||
];
|
||||
}
|
||||
|
||||
/** @param list<array<string,mixed>> $rows */
|
||||
private function storeInformationSummary(array $rows): array
|
||||
{
|
||||
$stores = [];
|
||||
$platforms = [];
|
||||
foreach ($rows as $row) {
|
||||
$key = trim((string) ($row['id'] ?? $row['erp_store_name'] ?? $row['store_name'] ?? ''));
|
||||
if ($key === '') {
|
||||
continue;
|
||||
}
|
||||
$stores[$key] = match ((string) ($row['store_status'] ?? '')) {
|
||||
'0', '正常' => '正常',
|
||||
'3', '关闭中' => '关闭中',
|
||||
'6', '已关闭', '关店' => '已关闭',
|
||||
default => (string) ($row['store_status'] ?? ''),
|
||||
};
|
||||
$platform = trim((string) ($row['platform'] ?? ''));
|
||||
if ($platform !== '') {
|
||||
$platforms[$platform] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$statusCounts = array_count_values($stores);
|
||||
|
||||
return [
|
||||
'total' => count($stores),
|
||||
'normal' => (int) ($statusCounts['正常'] ?? 0),
|
||||
'closing' => (int) ($statusCounts['关闭中'] ?? 0),
|
||||
'closed' => (int) ($statusCounts['已关闭'] ?? 0),
|
||||
'platforms' => count($platforms),
|
||||
];
|
||||
}
|
||||
|
||||
/** @param array<string,string|list<string>> $filters */
|
||||
@ -281,7 +414,39 @@ SQL);
|
||||
|
||||
$offset = ($page - 1) * $perPage;
|
||||
|
||||
return ['data' => array_slice($rows, $offset, $perPage), 'total' => count($rows)];
|
||||
return [
|
||||
'data' => array_slice($rows, $offset, $perPage),
|
||||
'total' => count($rows),
|
||||
'summary' => $this->storeReportSummary($rows),
|
||||
];
|
||||
}
|
||||
|
||||
/** @param list<array<string,mixed>> $rows */
|
||||
private function storeReportSummary(array $rows): array
|
||||
{
|
||||
$stores = [];
|
||||
$periodSales = 0.0;
|
||||
foreach ($rows as $row) {
|
||||
$key = trim((string) ($row['erp_store_name'] ?? ''));
|
||||
if ($key === '') {
|
||||
$key = trim((string) ($row['store_id'] ?? $row['id'] ?? ''));
|
||||
}
|
||||
if ($key === '') {
|
||||
continue;
|
||||
}
|
||||
$stores[$key] = (string) ($row['status'] ?? '');
|
||||
$periodSales += (float) ($row['period_sales'] ?? 0);
|
||||
}
|
||||
|
||||
$statusCounts = array_count_values($stores);
|
||||
|
||||
return [
|
||||
'stores' => count($stores),
|
||||
'normal' => (int) ($statusCounts['开店中'] ?? 0),
|
||||
'closing' => (int) ($statusCounts['关店中'] ?? 0),
|
||||
'closed' => (int) ($statusCounts['关店'] ?? 0),
|
||||
'period_sales' => round($periodSales, 2),
|
||||
];
|
||||
}
|
||||
|
||||
/** @return array{data:array<int,array<string,mixed>>,total:int} */
|
||||
@ -384,6 +549,11 @@ SQL);
|
||||
private function subjectOperatingReportPage(int $page, int $perPage): array
|
||||
{
|
||||
$filters = $this->pageFilters('company-management', 'subject-operating-report');
|
||||
$companyStatusReady = $this->mirror->ready('company-information.read');
|
||||
$companyStatus = trim((string) request('company_status', ''));
|
||||
if (in_array($companyStatus, ['正常', '已注销'], true)) {
|
||||
$filters['company_status'] = $companyStatus;
|
||||
}
|
||||
$rows = $this->storeReportRows(array_intersect_key($filters, array_flip(['company_type'])));
|
||||
$entities = [];
|
||||
|
||||
@ -420,6 +590,7 @@ SQL);
|
||||
foreach ($rows as &$row) {
|
||||
$row['company_details'] = $details[$row['entity']] ?? [];
|
||||
$row['city'] = $this->cityFromDetails($row['company_details']);
|
||||
$row['company_status'] = $row['company_details'][0]['company_status'] ?? null;
|
||||
}
|
||||
unset($row);
|
||||
|
||||
@ -430,11 +601,47 @@ SQL);
|
||||
);
|
||||
|
||||
$rows = array_values(array_filter($rows, fn (array $row): bool => $this->subjectMatchesFilters($row, $filters)));
|
||||
$summary = $this->subjectSummary($rows, $companyStatusReady);
|
||||
$this->sortSubjectRows($rows, $filters);
|
||||
$offset = ($page - 1) * $perPage;
|
||||
$pageRows = array_slice($rows, $offset, $perPage);
|
||||
|
||||
return ['data' => $pageRows, 'total' => count($rows)];
|
||||
return ['data' => $pageRows, 'total' => count($rows), 'summary' => $summary];
|
||||
}
|
||||
|
||||
/** @param list<array<string,mixed>> $rows */
|
||||
private function subjectSummary(array $rows, bool $companyStatusReady): array
|
||||
{
|
||||
$normal = 0;
|
||||
$deregistered = 0;
|
||||
$rollingIncome = 0.0;
|
||||
$currentMonthKey = 'income_' . now()->format('m');
|
||||
$currentMonthIncome = 0.0;
|
||||
foreach ($rows as $row) {
|
||||
$status = trim((string) ($row['company_status'] ?? ''));
|
||||
if ($status === '正常') {
|
||||
$normal++;
|
||||
} elseif ($status === '已注销') {
|
||||
$deregistered++;
|
||||
}
|
||||
if (($row['rolling_12m_income'] ?? null) !== null) {
|
||||
$rollingIncome += (float) $row['rolling_12m_income'];
|
||||
}
|
||||
if (($row[$currentMonthKey] ?? null) !== null) {
|
||||
$currentMonthIncome += (float) $row[$currentMonthKey];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'total' => count($rows),
|
||||
'normal' => $normal,
|
||||
'deregistered' => $deregistered,
|
||||
'rolling_income' => round($rollingIncome, 2),
|
||||
'current_month_income' => round($currentMonthIncome, 2),
|
||||
'current_month_number' => now()->format('m'),
|
||||
'current_month_label' => now()->format('Y年n月'),
|
||||
'company_status_ready' => $companyStatusReady,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -473,6 +680,11 @@ SQL);
|
||||
/** @param array<string,mixed> $row @param array<string,string> $filters */
|
||||
private function subjectMatchesFilters(array $row, array $filters): bool
|
||||
{
|
||||
$companyStatus = trim((string) ($filters['company_status'] ?? ''));
|
||||
if ($companyStatus !== '' && (string) ($row['company_status'] ?? '') !== $companyStatus) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($filters['company_type'] ?? '') !== '' && (string) ($row['company_type'] ?? '') !== (string) $filters['company_type']) {
|
||||
return false;
|
||||
}
|
||||
@ -831,6 +1043,7 @@ SQL);
|
||||
return [
|
||||
'data' => array_map($mapper, $payload['data']),
|
||||
'total' => (int) $payload['total'],
|
||||
'summary' => (array) ($payload['summary'] ?? []),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ class BusinessInformationMirrorRepository
|
||||
return $this->mirror->ready($this->dataset($scope));
|
||||
}
|
||||
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int} */
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int, summary?: array<string,mixed>} */
|
||||
public function paginate(string $scope, int $page, int $perPage, array $filters = []): array
|
||||
{
|
||||
if (! $this->ready($scope)) {
|
||||
@ -126,8 +126,13 @@ SQL)
|
||||
$query->where('c.businessLicenseType', '=', trim((string) $filters['company_type']));
|
||||
}
|
||||
|
||||
if (trim((string) ($filters['status'] ?? '')) !== '') {
|
||||
$query->where('s.shopState', '=', (string) $filters['status']);
|
||||
$status = trim((string) ($filters['store_status'] ?? ''));
|
||||
if ($status === '') {
|
||||
$status = trim((string) ($filters['status'] ?? ''));
|
||||
}
|
||||
if ($status !== '') {
|
||||
$statusCode = ['正常' => '0', '关闭中' => '3', '已关闭' => '6'][$status] ?? $status;
|
||||
$query->where('s.shopState', '=', $statusCode);
|
||||
}
|
||||
|
||||
if (trim((string) ($filters['opened_at_from'] ?? '')) !== '') {
|
||||
@ -161,7 +166,7 @@ SQL)
|
||||
->all();
|
||||
}
|
||||
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int} */
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int, summary: array<string,mixed>} */
|
||||
private function companies(int $page, int $perPage, array $filters): array
|
||||
{
|
||||
$query = $this->connection->table('ops_fys_company_info')
|
||||
@ -213,18 +218,29 @@ SQL);
|
||||
->orWhere('financialManager', 'like', $like);
|
||||
});
|
||||
}
|
||||
return $this->page($query, $page, $perPage, 'Id', $filters, [
|
||||
'unified_social_credit_code' => 'unifiedSocialCreditCode', 'company_name' => 'businessLicenseName',
|
||||
'taxpayer_type' => 'taxCategoryAndType', 'company_status' => 'companyStatus',
|
||||
'subscribed_capital' => 'registeredCapital', 'registered_at' => 'IncorporationDate',
|
||||
'legal_representative' => 'legalRepresentative', 'supervisor' => 'supervisor',
|
||||
'billing_officer' => 'financialManager', 'registered_address' => 'registeredAddress',
|
||||
'city' => 'registeredAddress', 'business_scope' => 'businessScope',
|
||||
'basic_deposit_account' => 'accountSerialNumber', 'subscribed_at' => 'registeredCapitalVaildTime',
|
||||
]);
|
||||
$summary = $this->summaryCounts($query, <<<'SQL'
|
||||
COUNT(*) AS total,
|
||||
COALESCE(SUM(CASE WHEN companyStatus = '0' THEN 1 ELSE 0 END), 0) AS normal,
|
||||
COALESCE(SUM(CASE WHEN companyStatus = '1' THEN 1 ELSE 0 END), 0) AS deregistered,
|
||||
COALESCE(SUM(CASE WHEN taxCategoryAndType = ? THEN 1 ELSE 0 END), 0) AS general_taxpayer,
|
||||
COALESCE(SUM(CASE WHEN taxCategoryAndType = ? THEN 1 ELSE 0 END), 0) AS small_taxpayer
|
||||
SQL, ['一般纳税人', '小规模纳税人']);
|
||||
|
||||
return [
|
||||
...$this->page($query, $page, $perPage, 'Id', $filters, [
|
||||
'unified_social_credit_code' => 'unifiedSocialCreditCode', 'company_name' => 'businessLicenseName',
|
||||
'taxpayer_type' => 'taxCategoryAndType', 'company_status' => 'companyStatus',
|
||||
'subscribed_capital' => 'registeredCapital', 'registered_at' => 'IncorporationDate',
|
||||
'legal_representative' => 'legalRepresentative', 'supervisor' => 'supervisor',
|
||||
'billing_officer' => 'financialManager', 'registered_address' => 'registeredAddress',
|
||||
'city' => 'registeredAddress', 'business_scope' => 'businessScope',
|
||||
'basic_deposit_account' => 'accountSerialNumber', 'subscribed_at' => 'registeredCapitalVaildTime',
|
||||
]),
|
||||
'summary' => $summary,
|
||||
];
|
||||
}
|
||||
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int} */
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int, summary: array<string,mixed>} */
|
||||
private function stores(int $page, int $perPage, array $filters): array
|
||||
{
|
||||
$query = $this->storeQuery();
|
||||
@ -247,14 +263,25 @@ SQL);
|
||||
$query->whereNull('s.shopBankAccount')->orWhere('s.shopBankAccount', '=', '');
|
||||
});
|
||||
}
|
||||
return $this->page($query, $page, $perPage, 's.Id', $filters, [
|
||||
'platform' => 's.platform', 'store_id' => 's.sotreId', 'store_name' => 's.erpShopName',
|
||||
'store_entity' => 'c.businessLicenseName', 'store_status' => 's.shopState',
|
||||
'trademark' => 't.trademarkName', 'trademark_number' => 's.trademarkNumber',
|
||||
'business_department' => 's.responsibleDepartment', 'store_manager' => 's.shopHead',
|
||||
'department_manager' => 's.customerDeptManager', 'opened_at' => 's.openTime',
|
||||
'renewed_at' => 's.renewalTime', 'withdrawal_account' => 's.shopBankAccount',
|
||||
]);
|
||||
$summary = $this->summaryCounts($query, <<<'SQL'
|
||||
COUNT(*) AS total,
|
||||
COALESCE(SUM(CASE WHEN s.shopState = 0 THEN 1 ELSE 0 END), 0) AS normal,
|
||||
COALESCE(SUM(CASE WHEN s.shopState = 3 THEN 1 ELSE 0 END), 0) AS closing,
|
||||
COALESCE(SUM(CASE WHEN s.shopState = 6 THEN 1 ELSE 0 END), 0) AS closed,
|
||||
COUNT(DISTINCT CASE WHEN s.platform IS NOT NULL AND s.platform <> '' THEN s.platform END) AS platforms
|
||||
SQL);
|
||||
|
||||
return [
|
||||
...$this->page($query, $page, $perPage, 's.Id', $filters, [
|
||||
'platform' => 's.platform', 'store_id' => 's.sotreId', 'store_name' => 's.erpShopName',
|
||||
'store_entity' => 'c.businessLicenseName', 'store_status' => 's.shopState',
|
||||
'trademark' => 't.trademarkName', 'trademark_number' => 's.trademarkNumber',
|
||||
'business_department' => 's.responsibleDepartment', 'store_manager' => 's.shopHead',
|
||||
'department_manager' => 's.customerDeptManager', 'opened_at' => 's.openTime',
|
||||
'renewed_at' => 's.renewalTime', 'withdrawal_account' => 's.shopBankAccount',
|
||||
]),
|
||||
'summary' => $summary,
|
||||
];
|
||||
}
|
||||
|
||||
private function storeQuery()
|
||||
@ -308,7 +335,7 @@ SQL);
|
||||
return $query;
|
||||
}
|
||||
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int} */
|
||||
/** @return array{data: array<int,array<string,mixed>>, total: int, summary: array<string,mixed>} */
|
||||
private function trademarks(int $page, int $perPage, array $filters): array
|
||||
{
|
||||
$query = $this->connection->table('ops_fys_trademark_info')
|
||||
@ -340,13 +367,35 @@ SQL);
|
||||
$statusCode = ['未启用' => '0', '有效' => '1'][$status] ?? $status;
|
||||
$query->where('trademarkStatus', '=', $statusCode);
|
||||
}
|
||||
return $this->page($query, $page, $perPage, 'Id', $filters, [
|
||||
'trademark_name' => 'trademarkName', 'trademark_number' => 'trademarkNumber',
|
||||
'trademark_status' => 'trademarkStatus', 'registration_date' => 'registrationDate',
|
||||
'expiry_date' => 'termOfValidity', 'international_classification' => 'internationalClassification',
|
||||
'approved_goods' => 'approvedCommodities', 'final_holder' => 'transferenceUser',
|
||||
'registered_address' => 'registrationAddress', 'custody_department' => 'custodyDepartment',
|
||||
]);
|
||||
$summary = $this->summaryCounts($query, <<<'SQL'
|
||||
COUNT(*) AS total,
|
||||
COALESCE(SUM(CASE WHEN trademarkStatus = '1' THEN 1 ELSE 0 END), 0) AS enabled,
|
||||
COALESCE(SUM(CASE WHEN trademarkStatus = '0' THEN 1 ELSE 0 END), 0) AS disabled,
|
||||
COUNT(DISTINCT CASE WHEN transferenceUser IS NOT NULL AND transferenceUser <> '' THEN transferenceUser END) AS holders,
|
||||
COUNT(DISTINCT CASE WHEN custodyDepartment IS NOT NULL AND custodyDepartment <> '' THEN custodyDepartment END) AS departments
|
||||
SQL);
|
||||
|
||||
return [
|
||||
...$this->page($query, $page, $perPage, 'Id', $filters, [
|
||||
'trademark_name' => 'trademarkName', 'trademark_number' => 'trademarkNumber',
|
||||
'trademark_status' => 'trademarkStatus', 'registration_date' => 'registrationDate',
|
||||
'expiry_date' => 'termOfValidity', 'international_classification' => 'internationalClassification',
|
||||
'approved_goods' => 'approvedCommodities', 'final_holder' => 'transferenceUser',
|
||||
'registered_address' => 'registrationAddress', 'custody_department' => 'custodyDepartment',
|
||||
]),
|
||||
'summary' => $summary,
|
||||
];
|
||||
}
|
||||
|
||||
/** @return array<string,int> */
|
||||
private function summaryCounts($query, string $sql, array $bindings = []): array
|
||||
{
|
||||
$row = (clone $query)
|
||||
->select([])
|
||||
->selectRaw($sql, $bindings)
|
||||
->first();
|
||||
|
||||
return array_map(static fn ($value): int => (int) $value, (array) $row);
|
||||
}
|
||||
|
||||
/** @param array<string,string> $textColumns @param array<string,string> $exactColumns @param array<string,string> $enumColumns */
|
||||
|
||||
@ -43,7 +43,7 @@ class StoreAccountMirrorRepository
|
||||
private readonly GenericBusinessMirrorRepository $mirror,
|
||||
) {}
|
||||
|
||||
/** @return array{data:array<int,array<string,mixed>>,total:int} */
|
||||
/** @return array{data:array<int,array<string,mixed>>,total:int,summary:array<string,int>} */
|
||||
public function paginate(int $page, int $perPage, array $filters = []): array
|
||||
{
|
||||
$dataset = $this->datasets->get(self::DATASET);
|
||||
@ -106,6 +106,17 @@ class StoreAccountMirrorRepository
|
||||
$query->whereIn('storeName', $this->storeNamesWithStatuses($statuses[$bucket], $expected));
|
||||
}
|
||||
}
|
||||
$summaryRow = (clone $query)
|
||||
->select([])
|
||||
->selectRaw(<<<'SQL'
|
||||
COUNT(*) AS total,
|
||||
COALESCE(SUM(CASE WHEN accountType = 'MAIN' THEN 1 ELSE 0 END), 0) AS main_accounts,
|
||||
COALESCE(SUM(CASE WHEN accountType = 'SUB' THEN 1 ELSE 0 END), 0) AS sub_accounts,
|
||||
COALESCE(SUM(CASE WHEN passwordConfigured = 1 THEN 1 ELSE 0 END), 0) AS password_set,
|
||||
COALESCE(SUM(CASE WHEN passwordConfigured = 0 THEN 1 ELSE 0 END), 0) AS password_missing
|
||||
SQL)
|
||||
->first();
|
||||
$summary = array_map(static fn ($value): int => (int) $value, (array) $summaryRow);
|
||||
$total = (clone $query)->count();
|
||||
$sortColumns = [
|
||||
'store_name' => 'storeName', 'operation_owner' => 'operationOwner',
|
||||
@ -174,7 +185,7 @@ class StoreAccountMirrorRepository
|
||||
})
|
||||
->all();
|
||||
|
||||
return ['data' => $rows, 'total' => $total];
|
||||
return ['data' => $rows, 'total' => $total, 'summary' => $summary];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
@php
|
||||
$summaryCards = $summaryCards ?? [];
|
||||
$summaryTitle = $page['title'] ?? '业务页面';
|
||||
@endphp
|
||||
|
||||
@once
|
||||
<style>
|
||||
.business-summary-cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
|
||||
gap: 0.6rem;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.business-summary-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
min-height: 5.4rem;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 0.8rem 2.25rem 0.8rem 0.9rem;
|
||||
border: 1px solid var(--vip-border, #d8d2c7);
|
||||
border-radius: 0.7rem;
|
||||
background: var(--vip-surface, #ffffff);
|
||||
color: var(--vip-content-ink, #171717);
|
||||
text-decoration: none;
|
||||
transition: border-color 160ms ease, background-color 160ms ease;
|
||||
}
|
||||
|
||||
.business-summary-card:nth-child(5n) {
|
||||
background: #fbf7ec;
|
||||
}
|
||||
|
||||
.business-summary-card:hover,
|
||||
.business-summary-card:focus-visible,
|
||||
.business-summary-card[aria-current="true"] {
|
||||
border-color: var(--vip-content-accent-dark, #856632);
|
||||
background: var(--vip-content-accent-soft, #f7f0de);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.business-summary-card__label,
|
||||
.business-summary-card__hint {
|
||||
overflow: hidden;
|
||||
color: var(--vip-content-muted, #595959);
|
||||
font-size: 0.69rem;
|
||||
line-height: 1.4;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.business-summary-card__value {
|
||||
overflow: hidden;
|
||||
margin: 0.25rem 0;
|
||||
color: var(--vip-content-ink, #171717);
|
||||
font-size: 1.18rem;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.business-summary-card__value--money {
|
||||
font-size: 1rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.business-summary-card__open {
|
||||
position: absolute;
|
||||
top: 0.55rem;
|
||||
right: 0.6rem;
|
||||
color: var(--vip-content-accent-dark, #856632);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.business-summary-cards {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.business-summary-card {
|
||||
min-height: 4.9rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 390px) {
|
||||
.business-summary-cards {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.business-summary-card {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endonce
|
||||
|
||||
@if ($summaryCards !== [])
|
||||
<nav class="business-summary-cards" aria-label="{{ $summaryTitle }}汇总指标" data-business-summary-cards>
|
||||
@foreach ($summaryCards as $card)
|
||||
@php
|
||||
$query = (array) ($card['query'] ?? []);
|
||||
$format = $card['format'] ?? 'integer';
|
||||
$formattedValue = match ($format) {
|
||||
'money' => '¥' . number_format((float) ($card['value'] ?? 0), 2),
|
||||
'text' => (string) ($card['value'] ?? '—'),
|
||||
default => number_format((int) ($card['value'] ?? 0)),
|
||||
};
|
||||
$activeQuery = collect($query)
|
||||
->filter(fn ($value, string $key): bool => $key !== 'page' && $value !== null && $value !== '');
|
||||
$isActive = $activeQuery->isNotEmpty()
|
||||
&& $activeQuery->every(fn ($value, string $key): bool => (string) request($key) === (string) $value);
|
||||
@endphp
|
||||
<a
|
||||
class="business-summary-card{{ $format === 'money' ? ' business-summary-card--money' : '' }}"
|
||||
href="{{ rtrim(request()->fullUrlWithQuery($query), '?') }}"
|
||||
data-business-summary-card="{{ $card['label'] ?? '' }}"
|
||||
aria-label="{{ $card['label'] ?? '' }}:{{ $formattedValue }},查看明细"
|
||||
@if ($isActive) aria-current="true" @endif
|
||||
>
|
||||
<span class="business-summary-card__label">{{ $card['label'] ?? '' }}</span>
|
||||
<strong class="business-summary-card__value{{ $format === 'money' ? ' business-summary-card__value--money' : '' }}">{{ $formattedValue }}</strong>
|
||||
<span class="business-summary-card__hint" title="{{ $card['hint'] ?? '' }}">{{ $card['hint'] ?? '' }}</span>
|
||||
<span class="material-icons-outlined business-summary-card__open" aria-hidden="true">arrow_outward</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</nav>
|
||||
@endif
|
||||
@ -2705,6 +2705,9 @@
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
@include('business.pages.partials.business-summary-cards', [
|
||||
'summaryCards' => request()->attributes->get('business-page-summary-cards', []),
|
||||
])
|
||||
@if (! $directoryUsesFieldQuery)
|
||||
@php
|
||||
$directoryMonthOptions = [];
|
||||
|
||||
@ -50,6 +50,49 @@ class PrototypePageTest extends FeatureTestCase
|
||||
->assertDontSeeText('共享镜像中暂未读取到店铺账号数据');
|
||||
}
|
||||
|
||||
public function testSharedBusinessPagesRenderClickableSummaryCards(): void
|
||||
{
|
||||
$rows = new LengthAwarePaginator([(object) [
|
||||
'id' => 'account-summary',
|
||||
'store_name' => '汇总测试店铺',
|
||||
'account_type' => '主账号',
|
||||
'account' => 'summary-account',
|
||||
'password_configured' => true,
|
||||
]], 958, 50, 1, ['path' => '/']);
|
||||
|
||||
$this->mock(\App\Business\UpstreamBusinessInformation::class)
|
||||
->shouldReceive('paginate')
|
||||
->once()
|
||||
->with('store-management', 'store-accounts', 50)
|
||||
->andReturnUsing(function () use ($rows): LengthAwarePaginator {
|
||||
request()->attributes->set('business-page-summary-cards', [
|
||||
['label' => '账号总数', 'value' => 958, 'hint' => '当前筛选内账号记录', 'format' => 'integer', 'query' => ['page' => null]],
|
||||
['label' => '主账号', 'value' => 640, 'hint' => '账号类型为 MAIN', 'format' => 'integer', 'query' => ['page' => null, 'account_type' => '主账号']],
|
||||
['label' => '子账号', 'value' => 318, 'hint' => '账号类型为 SUB', 'format' => 'integer', 'query' => ['page' => null, 'account_type' => '子账号']],
|
||||
]);
|
||||
|
||||
return $rows;
|
||||
});
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', [
|
||||
'section' => 'store-management',
|
||||
'page' => 'store-accounts',
|
||||
'account_type' => '主账号',
|
||||
]))
|
||||
->assertOk()
|
||||
->assertSee('data-business-summary-cards', false)
|
||||
->assertSee('data-business-summary-card="账号总数"', false)
|
||||
->assertSee('data-business-summary-card="主账号"', false)
|
||||
->assertSee('data-business-summary-card="子账号"', false)
|
||||
->assertSee('account_type=', false)
|
||||
->assertSee('aria-current="true"', false)
|
||||
->assertSeeText('958')
|
||||
->assertSeeText('640')
|
||||
->assertSeeText('318')
|
||||
->assertSee('查看明细', false);
|
||||
}
|
||||
|
||||
public function testNavigationUsesConfiguredPermissionsAndTitles(): void
|
||||
{
|
||||
$this->user->roles()->sync([\App\Models\Auth\Role::where('name', 'admin')->firstOrFail()->id]);
|
||||
|
||||
@ -64,6 +64,10 @@ class BusinessInformationMirrorRepositoryTest extends TestCase
|
||||
'legalRepresentative' => '张三',
|
||||
'registeredAddress' => '上海市浦东新区测试路1号',
|
||||
]);
|
||||
$connection->table('ops_fys_company_info')->where('Id', 3)->update([
|
||||
'companyStatus' => '1',
|
||||
'taxCategoryAndType' => '一般纳税人',
|
||||
]);
|
||||
$connection->table('ops_fys_shop_info')->where('Id', 8)->update(['sotreId' => 'STORE-8', 'renewalTime' => '2027-08-14', 'shopBankAccount' => 'fixture-account', 'trademarkNumber' => 'TM-5']);
|
||||
$connection->table('ops_fys_trademark_info')->where('Id', 5)->update(['trademarkNumber' => 'TM-5', 'approvedCommodities' => '家具', 'transferenceUser' => '测试持有人', 'registrationAddress' => '测试地址', 'custodyDepartment' => '资料部']);
|
||||
|
||||
@ -75,6 +79,9 @@ class BusinessInformationMirrorRepositoryTest extends TestCase
|
||||
'store_name' => '上游店铺名',
|
||||
'store_id' => 'STORE-8',
|
||||
]);
|
||||
$normalStores = $this->repository->allStores(['store_status' => '正常']);
|
||||
$closedStores = $this->repository->allStores(['store_status' => '已关闭']);
|
||||
$legacyStatusStores = $this->repository->allStores(['status' => '0']);
|
||||
$filteredStore = $this->repository->paginate('store-information.read', 1, 20, [
|
||||
'platform' => '天猫', 'store_status' => '0', 'opened_at_from' => '2026-08-14',
|
||||
]);
|
||||
@ -98,6 +105,9 @@ class BusinessInformationMirrorRepositoryTest extends TestCase
|
||||
$this->assertSame('STORE-8', $store['data'][0]['store_id']);
|
||||
$this->assertSame('上游店铺名', $store['data'][0]['store_name']);
|
||||
$this->assertCount(1, $filteredStores);
|
||||
$this->assertCount(1, $normalStores);
|
||||
$this->assertSame([], $closedStores);
|
||||
$this->assertCount(1, $legacyStatusStores);
|
||||
$this->assertSame([], $this->repository->allStores(['store_id' => '测试店']));
|
||||
$this->assertSame('2027-08-14', $store['data'][0]['renewed_at']);
|
||||
$this->assertSame('负责人', $store['data'][0]['store_manager']);
|
||||
@ -114,6 +124,29 @@ class BusinessInformationMirrorRepositoryTest extends TestCase
|
||||
$this->assertSame('新公司', $relatedCompany['data'][0]['company_name']);
|
||||
$this->assertSame(1, $typedCompany['total']);
|
||||
$this->assertSame(1, $cityCompany['total']);
|
||||
$this->assertSame([
|
||||
'total' => 3,
|
||||
'normal' => 2,
|
||||
'deregistered' => 1,
|
||||
'general_taxpayer' => 1,
|
||||
'small_taxpayer' => 1,
|
||||
], $companies['summary']);
|
||||
$this->assertSame([
|
||||
'total' => 1,
|
||||
'normal' => 1,
|
||||
'closing' => 0,
|
||||
'closed' => 0,
|
||||
'platforms' => 1,
|
||||
], $store['summary']);
|
||||
$this->assertSame([
|
||||
'total' => 1,
|
||||
'enabled' => 1,
|
||||
'disabled' => 0,
|
||||
'holders' => 1,
|
||||
'departments' => 1,
|
||||
], $trademarks['summary']);
|
||||
$this->assertSame(1, $filteredCompany['summary']['total']);
|
||||
$this->assertSame(1, $filteredTrademark['summary']['enabled']);
|
||||
}
|
||||
|
||||
public function test_dataset_is_not_ready_until_initial_full_sync_is_marked_complete(): void
|
||||
|
||||
@ -107,7 +107,8 @@ class StoreAccountMirrorRepositoryTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
$rows = collect($this->repository->paginate(1, 50)['data'])->keyBy('id');
|
||||
$payload = $this->repository->paginate(1, 50);
|
||||
$rows = collect($payload['data'])->keyBy('id');
|
||||
|
||||
$this->assertSame('主账号', $rows['account-' . md5('MAIN')]['account_type']);
|
||||
$this->assertSame('子账号', $rows['account-' . md5('SUB')]['account_type']);
|
||||
@ -115,6 +116,13 @@ class StoreAccountMirrorRepositoryTest extends TestCase
|
||||
$this->assertTrue($rows['account-' . md5('MAIN')]['password_configured']);
|
||||
$this->assertFalse($rows['account-' . md5('SUB')]['password_configured']);
|
||||
$this->assertNull($rows['account-' . md5('/')]['password_configured']);
|
||||
$this->assertSame([
|
||||
'total' => 3,
|
||||
'main_accounts' => 1,
|
||||
'sub_accounts' => 1,
|
||||
'password_set' => 1,
|
||||
'password_missing' => 1,
|
||||
], $payload['summary']);
|
||||
|
||||
$sorted = $this->repository->paginate(1, 50, ['_sort' => 'store_name', '_direction' => 'asc']);
|
||||
$this->assertSame(['A店铺', 'B店铺', 'C店铺'], array_column($sorted['data'], 'store_name'));
|
||||
|
||||
@ -288,6 +288,12 @@ class StoreReportRepositoryTest extends TestCase
|
||||
$this->assertSame('店铺负责人', $paginator->items()[0]->store_manager);
|
||||
$this->assertSame('部门负责人', $paginator->items()[0]->department_manager);
|
||||
$this->assertSame('运营中心A', $paginator->items()[0]->profit_center);
|
||||
$summaryCards = collect($this->app['request']->attributes->get('business-page-summary-cards'))->keyBy('label');
|
||||
$this->assertSame(1, $summaryCards['店铺总数']['value']);
|
||||
$this->assertSame(1, $summaryCards['正常店铺']['value']);
|
||||
$this->assertSame(0, $summaryCards['关店中']['value']);
|
||||
$this->assertSame(0, $summaryCards['已关闭']['value']);
|
||||
$this->assertSame(60.0, (float) $summaryCards['期间销量']['value']);
|
||||
}
|
||||
|
||||
public function test_store_report_hides_sales_months_without_data_by_default(): void
|
||||
@ -328,12 +334,19 @@ class StoreReportRepositoryTest extends TestCase
|
||||
$this->insertBill('店铺B', '2026-08-11', 40);
|
||||
$mirror = Mockery::mock(BusinessInformationMirrorRepository::class);
|
||||
$mirror->shouldReceive('ready')->with('store-information.read')->andReturnTrue();
|
||||
$mirror->shouldReceive('allStores')->times(3)->andReturn([
|
||||
$mirror->shouldReceive('allStores')->times(5)->andReturn([
|
||||
['erp_store_name' => '店铺A', 'company_name' => '主体甲', 'store_status' => '0'],
|
||||
['erp_store_name' => '店铺B', 'company_name' => '主体甲', 'store_status' => '0'],
|
||||
]);
|
||||
$mirror->shouldReceive('ready')->with('company-information.read')->andReturnTrue();
|
||||
$mirror->shouldReceive('companiesByNames')->andReturn([]);
|
||||
$mirror->shouldReceive('companiesByNames')->andReturn([
|
||||
'主体甲' => [[
|
||||
'Id' => 1,
|
||||
'businessLicenseName' => '主体甲',
|
||||
'companyStatus' => '0',
|
||||
'registeredAddress' => '常州市测试路1号',
|
||||
]],
|
||||
]);
|
||||
$accounts = Mockery::mock(StoreAccountMirrorRepository::class);
|
||||
$accounts->shouldReceive('ownershipByStoreName')->andReturn([]);
|
||||
$service = new UpstreamBusinessInformation(
|
||||
@ -351,9 +364,19 @@ class StoreReportRepositoryTest extends TestCase
|
||||
$this->assertSame(90.0, $rows[0]->rolling_12m_income);
|
||||
$this->assertSame(20.0, $rows[0]->income_07);
|
||||
$this->assertSame(70.0, $rows[0]->income_08);
|
||||
$summaryCards = collect($this->app['request']->attributes->get('business-page-summary-cards'))->keyBy('label');
|
||||
$this->assertSame(1, $summaryCards['主体总数']['value']);
|
||||
$this->assertSame(1, $summaryCards['有效主体']['value']);
|
||||
$this->assertSame(0, $summaryCards['已注销主体']['value']);
|
||||
$this->assertSame(90.0, (float) $summaryCards['最近12个月收入']['value']);
|
||||
|
||||
request()->merge(['income_08' => '70.00']);
|
||||
$this->assertSame(1, $service->paginate('company-management', 'subject-operating-report', 50)->total());
|
||||
request()->merge(['company_status' => '正常']);
|
||||
$this->assertSame(1, $service->paginate('company-management', 'subject-operating-report', 50)->total());
|
||||
request()->merge(['company_status' => '已注销']);
|
||||
$this->assertSame(0, $service->paginate('company-management', 'subject-operating-report', 50)->total());
|
||||
request()->merge(['company_status' => null]);
|
||||
request()->merge(['income_08' => '71.00']);
|
||||
$this->assertSame(0, $service->paginate('company-management', 'subject-operating-report', 50)->total());
|
||||
}
|
||||
|
||||
@ -122,12 +122,16 @@ class UpstreamBusinessInformationTest extends TestCase
|
||||
'erp_store_name' => '拼多多_测试店铺',
|
||||
'store_manager' => '旧店铺负责人',
|
||||
'department_manager' => '旧部门负责人',
|
||||
'store_status' => '0',
|
||||
'platform' => '拼多多',
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'erp_store_name' => '拼多多-其他店铺',
|
||||
'store_manager' => '其他负责人',
|
||||
'department_manager' => '其他部门负责人',
|
||||
'store_status' => '6',
|
||||
'platform' => '拼多多',
|
||||
],
|
||||
]);
|
||||
$accounts = Mockery::mock(StoreAccountMirrorRepository::class);
|
||||
@ -156,6 +160,60 @@ class UpstreamBusinessInformationTest extends TestCase
|
||||
$this->assertSame('正确店铺负责人', $paginator->items()[0]->store_manager);
|
||||
$this->assertSame('正确部门负责人', $paginator->items()[0]->department_manager);
|
||||
$this->assertNotSame('运营总监', $paginator->items()[0]->department_manager);
|
||||
$summaryCards = collect($this->app['request']->attributes->get('business-page-summary-cards'))->keyBy('label');
|
||||
$this->assertSame(1, $summaryCards['店铺总数']['value']);
|
||||
$this->assertSame(1, $summaryCards['正常店铺']['value']);
|
||||
$this->assertSame(0, $summaryCards['关闭中']['value']);
|
||||
$this->assertSame(0, $summaryCards['已关闭']['value']);
|
||||
$this->assertSame(1, $summaryCards['平台数']['value']);
|
||||
}
|
||||
|
||||
public function test_company_and_trademark_mirror_summaries_become_clickable_cards(): void
|
||||
{
|
||||
$mirror = Mockery::mock(BusinessInformationMirrorRepository::class);
|
||||
$mirror->shouldReceive('ready')->times(2)->andReturnUsing(
|
||||
static fn (string $scope): bool => in_array($scope, ['company-information.read', 'trademark-information.read'], true),
|
||||
);
|
||||
$mirror->shouldReceive('paginate')->once()->with('company-information.read', 1, 50, [])->andReturn([
|
||||
'data' => [],
|
||||
'total' => 818,
|
||||
'summary' => [
|
||||
'total' => 818,
|
||||
'normal' => 520,
|
||||
'deregistered' => 298,
|
||||
'general_taxpayer' => 123,
|
||||
'small_taxpayer' => 606,
|
||||
],
|
||||
]);
|
||||
$mirror->shouldReceive('paginate')->once()->with('trademark-information.read', 1, 50, [])->andReturn([
|
||||
'data' => [],
|
||||
'total' => 593,
|
||||
'summary' => [
|
||||
'total' => 593,
|
||||
'enabled' => 548,
|
||||
'disabled' => 45,
|
||||
'holders' => 5,
|
||||
'departments' => 6,
|
||||
],
|
||||
]);
|
||||
|
||||
$information = new UpstreamBusinessInformation(
|
||||
Mockery::mock(UpstreamQueryCacheFactory::class),
|
||||
$mirror,
|
||||
null,
|
||||
);
|
||||
$information->paginate('company-management', 'basic-information', 50);
|
||||
$companyCards = collect($this->app['request']->attributes->get('business-page-summary-cards'))->keyBy('label');
|
||||
$this->assertSame(818, $companyCards['公司总数']['value']);
|
||||
$this->assertSame(['page' => null, 'company_status' => '正常'], $companyCards['正常公司']['query']);
|
||||
$this->assertSame(['page' => null, 'taxpayer_type' => '一般纳税人'], $companyCards['一般纳税人']['query']);
|
||||
|
||||
$information->paginate('trademark-management', 'information', 50);
|
||||
$trademarkCards = collect($this->app['request']->attributes->get('business-page-summary-cards'))->keyBy('label');
|
||||
$this->assertSame(593, $trademarkCards['商标总数']['value']);
|
||||
$this->assertSame(45, $trademarkCards['未启用']['value']);
|
||||
$this->assertSame(['page' => null, 'trademark_status' => '有效'], $trademarkCards['有效商标']['query']);
|
||||
$this->assertSame('final_holder', $trademarkCards['最终持有人']['query']['sort']);
|
||||
}
|
||||
|
||||
public function test_bootstrap_without_mirror_explains_shared_connection_instead_of_requesting_upstream_credentials(): void
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user