This commit is contained in:
nanguaboss
2026-08-06 00:50:23 +08:00
parent 595520822a
commit 2cb688ed46
29 changed files with 5227 additions and 186 deletions
+4 -2
View File
@@ -36,6 +36,7 @@ $map = [
'industry' => 'industry', 'industry_subdivision' => 'industry_subdivision', 'website' => 'website',
'registered_capital' => 'registered_capital', 'established_date' => 'established_date',
'is_listed' => 'is_listed', 'stock_code' => 'stock_code',
'source_channel' => 'source_channel', 'source_detail' => 'source_detail',
];
$pdo = DB::getInstance()->getPdo();
@@ -46,8 +47,8 @@ $stmt = $pdo->prepare(
"INSERT INTO companies
(name_zh, name_en, display_name, business_role, country, registration_number,
address, legal_form, legal_representative, industry, industry_subdivision, website,
registered_capital, established_date, is_listed, stock_code)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
registered_capital, established_date, is_listed, stock_code, source_channel, source_detail)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
);
while (($row = fgetcsv($handle)) !== false) {
@@ -72,6 +73,7 @@ while (($row = fgetcsv($handle)) !== false) {
$rec['industry'] ?? null, $rec['industry_subdivision'] ?? null, $rec['website'] ?? null,
$rec['registered_capital'] ?? null, $rec['established_date'],
($rec['is_listed'] ?? 0) ? 1 : 0, $rec['stock_code'] ?? null,
$rec['source_channel'] ?? null, $rec['source_detail'] ?? null,
]);
$inserted++;
} catch (Exception $e) {