0806
This commit is contained in:
@@ -32,7 +32,7 @@ $stmt = $pdo->prepare(
|
||||
"SELECT id, name_zh, name_en, business_role, country, registration_number,
|
||||
address, legal_representative, industry, industry_subdivision, website,
|
||||
registered_capital, established_date, latest_employee_count, latest_annual_revenue,
|
||||
is_listed, stock_code, created_at
|
||||
is_listed, stock_code, source_channel, source_detail, created_at
|
||||
FROM companies WHERE id IN ($in) AND is_active = 1 ORDER BY id DESC"
|
||||
);
|
||||
$stmt->execute($idList);
|
||||
@@ -44,14 +44,14 @@ header('Content-Type: text/csv; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename="companies_' . date('Ymd_His') . '.csv"');
|
||||
echo "\xEF\xBB\xBF"; // UTF-8 BOM,便于 Excel 直接打开
|
||||
$out = fopen('php://output', 'w');
|
||||
fputcsv($out, ['ID', '公司名称', '英文名称', '业务角色', '国家/地区', '注册号', '地址', '法人', '行业', '行业细分', '官网', '注册资本', '成立日期', '员工数', '年营收', '是否上市', '股票代码', '创建时间']);
|
||||
fputcsv($out, ['ID', '公司名称', '英文名称', '业务角色', '国家/地区', '注册号', '地址', '法人', '行业', '行业细分', '官网', '注册资本', '成立日期', '员工数', '年营收', '是否上市', '股票代码', '来源渠道', '来源详情', '创建时间']);
|
||||
foreach ($list as $r) {
|
||||
fputcsv($out, [
|
||||
$r['id'], $r['name_zh'], $r['name_en'], $r['business_role'],
|
||||
$r['country'], $r['registration_number'], $r['address'], $r['legal_representative'],
|
||||
$r['industry'], $r['industry_subdivision'], $r['website'], $r['registered_capital'],
|
||||
$r['established_date'], $r['latest_employee_count'], $r['latest_annual_revenue'],
|
||||
$r['is_listed'], $r['stock_code'], date('Y-m-d', strtotime($r['created_at'])),
|
||||
$r['is_listed'], $r['stock_code'], $r['source_channel'], $r['source_detail'], date('Y-m-d', strtotime($r['created_at'])),
|
||||
]);
|
||||
}
|
||||
fclose($out);
|
||||
|
||||
Reference in New Issue
Block a user