* Date: 2026-5-30 */ if (!defined('ROOT_PATH')) { exit('Access Denied'); } $pageTitle = '首页'; $extraHead = ''; $slideList = $db->fetchAll("SELECT * FROM {$db->table('slide')} WHERE status = 1 ORDER BY sort_order ASC, id DESC LIMIT 5"); $articleChannels = $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE parent_id = 23 AND channel_type = 1 AND is_show = 1 ORDER BY list_order ASC, id ASC LIMIT 3"); if (!$articleChannels) { $articleChannels = $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE channel_type = 1 AND is_show = 1 ORDER BY list_order ASC, id ASC LIMIT 3"); } $productChannels = $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE parent_id = 22 AND is_show = 1 ORDER BY list_order ASC, id ASC"); if (!$productChannels) { $productChannels = $db->fetchAll("SELECT * FROM {$db->table('channel')} WHERE channel_type = 2 AND is_show = 1 ORDER BY list_order ASC, id ASC LIMIT 8"); } $allProducts = $db->fetchAll("SELECT p.*, c.channel_name FROM {$db->table('product')} p LEFT JOIN {$db->table('channel')} c ON p.channel_id=c.id WHERE p.status = 1 ORDER BY p.create_time DESC LIMIT 8"); $productMap = []; if ($productChannels) { foreach ($productChannels as $pch) { $productMap[$pch['id']] = $db->fetchAll("SELECT p.*, c.channel_name FROM {$db->table('product')} p LEFT JOIN {$db->table('channel')} c ON p.channel_id=c.id WHERE p.status = 1 AND p.channel_id = ? ORDER BY p.create_time DESC LIMIT 8", [$pch['id']]); } } $caseProducts = $db->fetchAll("SELECT p.*, c.channel_name FROM {$db->table('product')} p LEFT JOIN {$db->table('channel')} c ON p.channel_id=c.id WHERE p.status = 1 AND p.litpic <> '' ORDER BY p.create_time DESC LIMIT 5"); $recommendImage = $db->fetch("SELECT litpic FROM {$db->table('article')} WHERE litpic <> '' AND status = 1 ORDER BY create_time DESC LIMIT 1"); if (!$recommendImage) { $recommendImage = $db->fetch("SELECT litpic FROM {$db->table('product')} WHERE litpic <> '' AND status = 1 ORDER BY create_time DESC LIMIT 1"); } $thumbProducts = []; $companyIntro = trim($siteConfig['company_intro'] ?? ''); require_once __DIR__ . '/_header.php'; ?>