query($sqlStr); header("Location: ?Keys=" . $keys . "&Page=" . $page); exit; } } $keys = $_GET['Keys'] ?? ''; $keyscode = textEncode($keys); $page = $_GET['Page'] ?? ''; $filterCountry = $_GET['fliterCountry'] ?? ''; $filterQudao = $_GET['fliterQudao'] ?? ''; $filterDeal = $_GET['fliterDeal'] ?? ''; $filterBusiness = $_GET['fliterBusiness'] ?? ''; $filterContact = $_GET['fliterContact'] ?? ''; $filterStr = ""; $urlStr = ""; if (!empty($filterCountry)) { $filterStr .= " AND c.cs_country=" . (int)$filterCountry; $urlStr .= "&fliterCountry=" . $filterCountry; } if (!empty($filterQudao)) { $filterStr .= " AND c.cs_from=" . (int)$filterQudao; $urlStr .= "&fliterQudao=" . $filterQudao; } if (!empty($filterDeal)) { $filterStr .= " AND c.cs_deal=" . (int)$filterDeal; $urlStr .= "&fliterDeal=" . $filterDeal; } if (!empty($filterBusiness)) { $filterStr .= " AND c.cs_type=" . (int)$filterBusiness; $urlStr .= "&fliterBusiness=" . $filterBusiness; } if (!empty($filterContact)) { switch ($filterContact) { case "1": $filterStr .= " AND (cc.tel_1 IS NOT NULL AND cc.tel_1 <> '' OR cc.tel_2 IS NOT NULL AND cc.tel_2 <> '' OR cc.tel_3 IS NOT NULL AND cc.tel_3 <> '')"; break; case "2": $filterStr .= " AND (cc.wechat_1 IS NOT NULL AND cc.wechat_1 <> '' OR cc.wechat_2 IS NOT NULL AND cc.wechat_2 <> '' OR cc.wechat_3 IS NOT NULL AND cc.wechat_3 <> '')"; break; case "3": $filterStr .= " AND (cc.whatsapp_1 IS NOT NULL AND cc.whatsapp_1 <> '' OR cc.whatsapp_2 IS NOT NULL AND cc.whatsapp_2 <> '' OR cc.whatsapp_3 IS NOT NULL AND cc.whatsapp_3 <> '')"; break; case "4": $filterStr .= " AND (cc.email_1 IS NOT NULL AND cc.email_1 <> '' OR cc.email_2 IS NOT NULL AND cc.email_2 <> '' OR cc.email_3 IS NOT NULL AND cc.email_3 <> '')"; break; case "5": $filterStr .= " AND (cc.linkedin_1 IS NOT NULL AND cc.linkedin_1 <> '' OR cc.linkedin_2 IS NOT NULL AND cc.linkedin_2 <> '' OR cc.linkedin_3 IS NOT NULL AND cc.linkedin_3 <> '')"; break; case "6": $filterStr .= " AND (cc.facebook_1 IS NOT NULL AND cc.facebook_1 <> '' OR cc.facebook_2 IS NOT NULL AND cc.facebook_2 <> '' OR cc.facebook_3 IS NOT NULL AND cc.facebook_3 <> '')"; break; default: $filterStr .= " AND (cc.alibaba_1 IS NOT NULL AND cc.alibaba_1 <> '' OR cc.alibaba_2 IS NOT NULL AND cc.alibaba_2 <> '' OR cc.alibaba_3 IS NOT NULL AND cc.alibaba_3 <> '')"; } $urlStr .= "&fliterContact=" . $filterContact; } $keys = urlencode($keys); $hrefstr = "?keys=" . $keys; ?>

当月新增客户

序号
客户编号
渠道来源
区域
客户类型
是否成交
颜色标记
录入时间
操作
real_escape_string($keyscode); $sql = "SELECT c.id, MAX(c.cs_code) as cs_code, MAX(c.cs_from) as cs_from, MAX(c.cs_country) as cs_country, MAX(c.cs_type) as cs_type, MAX(c.cs_deal) as cs_deal, MAX(c.cs_addtime) as cs_addtime, MAX(c.colorTag) as colorTag, MAX(c.cs_note) as cs_note, GROUP_CONCAT(DISTINCT cc.id) as contact_ids, GROUP_CONCAT(DISTINCT cc.contact_name) as contact_names, GROUP_CONCAT(DISTINCT cc.tel_1) as tel_1_list, GROUP_CONCAT(DISTINCT cc.tel_2) as tel_2_list, GROUP_CONCAT(DISTINCT cc.tel_3) as tel_3_list, GROUP_CONCAT(DISTINCT cc.email_1) as email_1_list, GROUP_CONCAT(DISTINCT cc.email_2) as email_2_list, GROUP_CONCAT(DISTINCT cc.email_3) as email_3_list, GROUP_CONCAT(DISTINCT cc.whatsapp_1) as whatsapp_1_list, GROUP_CONCAT(DISTINCT cc.whatsapp_2) as whatsapp_2_list, GROUP_CONCAT(DISTINCT cc.whatsapp_3) as whatsapp_3_list, GROUP_CONCAT(DISTINCT cc.wechat_1) as wechat_1_list, GROUP_CONCAT(DISTINCT cc.wechat_2) as wechat_2_list, GROUP_CONCAT(DISTINCT cc.wechat_3) as wechat_3_list, GROUP_CONCAT(DISTINCT cc.linkedin_1) as linkedin_1_list, GROUP_CONCAT(DISTINCT cc.linkedin_2) as linkedin_2_list, GROUP_CONCAT(DISTINCT cc.linkedin_3) as linkedin_3_list, GROUP_CONCAT(DISTINCT cc.facebook_1) as facebook_1_list, GROUP_CONCAT(DISTINCT cc.facebook_2) as facebook_2_list, GROUP_CONCAT(DISTINCT cc.facebook_3) as facebook_3_list, GROUP_CONCAT(DISTINCT cc.alibaba_1) as alibaba_1_list, GROUP_CONCAT(DISTINCT cc.alibaba_2) as alibaba_2_list, GROUP_CONCAT(DISTINCT cc.alibaba_3) as alibaba_3_list FROM customer c LEFT JOIN customer_contact cc ON c.id = cc.customer_id WHERE c.cs_belong=" . $employee_id . " AND MONTH(c.cs_addtime) = MONTH(CURRENT_DATE()) AND YEAR(c.cs_addtime) = YEAR(CURRENT_DATE()) AND (c.cs_code LIKE '%" . $escapedKeyscode . "%' OR cc.contact_name LIKE '%" . $escapedKeyscode . "%' OR cc.email_1 LIKE '%" . $escapedKeyscode . "%' OR cc.email_2 LIKE '%" . $escapedKeyscode . "%' OR cc.email_3 LIKE '%" . $escapedKeyscode . "%' OR cc.wechat_1 LIKE '%" . $escapedKeyscode . "%' OR cc.wechat_2 LIKE '%" . $escapedKeyscode . "%' OR cc.wechat_3 LIKE '%" . $escapedKeyscode . "%' OR cc.tel_1 LIKE '%" . $escapedKeyscode . "%' OR cc.tel_2 LIKE '%" . $escapedKeyscode . "%' OR cc.tel_3 LIKE '%" . $escapedKeyscode . "%' OR cc.whatsapp_1 LIKE '%" . $escapedKeyscode . "%' OR cc.whatsapp_2 LIKE '%" . $escapedKeyscode . "%' OR cc.whatsapp_3 LIKE '%" . $escapedKeyscode . "%')" . $filterStr . " GROUP BY c.id ORDER BY c.id DESC"; $result = $conn->query($sql); if ($result && $result->num_rows > 0) { $pageSize = 20; $page = empty($page) ? 1 : $page; $page = ($page === 'end') ? ceil($result->num_rows / $pageSize) : $page; $page = (!is_numeric($page) || $page < 1) ? 1 : (int)$page; $totalPages = ceil($result->num_rows / $pageSize); $page = ($page > $totalPages) ? $totalPages : $page; $offset = $pageSize * ($page - 1); // Store results in array for pagination $rows = []; while ($row = $result->fetch_assoc()) { $rows[] = $row; } // Get paginated results $paginatedRows = array_slice($rows, $offset, $pageSize); $tempNum = $offset; foreach ($paginatedRows as $row) { $tempNum++; ?>
query("SELECT ch_name FROM qudao WHERE id=" . $cs_from); echo ($qudaoRow = $qudaoResult->fetch_assoc()) ? htmlspecialcharsFix($qudaoRow['ch_name']) : '未填写'; ?>
query("SELECT countryName FROM country WHERE id=" . $cs_country); echo ($countryRow = $countryResult->fetch_assoc()) ? htmlspecialcharsFix($countryRow['countryName']) : '未填写'; ?>
query("SELECT businessType FROM clienttype WHERE id=" . $cs_type); echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写'; ?>
成交"; } elseif ($row['cs_deal'] == 2) { echo "明确需求"; } elseif ($row['cs_deal'] == 1) { echo "背景调查"; } else { echo "无响应"; } ?>
联系方式
'; if (!empty($row['tel_1_list'])) echo htmlspecialcharsFix($row['tel_1_list']) . '
'; if (!empty($row['tel_2_list'])) echo htmlspecialcharsFix($row['tel_2_list']) . '
'; if (!empty($row['tel_3_list'])) echo htmlspecialcharsFix($row['tel_3_list']); echo '
'; echo '
'; if (!empty($row['email_1_list'])) echo '' . htmlspecialcharsFix($row['email_1_list']) . '
'; if (!empty($row['email_2_list'])) echo '' . htmlspecialcharsFix($row['email_2_list']) . '
'; if (!empty($row['email_3_list'])) echo '' . htmlspecialcharsFix($row['email_3_list']) . ''; echo '
'; echo '
'; if (!empty($row['whatsapp_1_list'])) echo htmlspecialcharsFix($row['whatsapp_1_list']) . '
'; if (!empty($row['whatsapp_2_list'])) echo htmlspecialcharsFix($row['whatsapp_2_list']) . '
'; if (!empty($row['whatsapp_3_list'])) echo htmlspecialcharsFix($row['whatsapp_3_list']); echo '
'; echo '
'; if (!empty($row['wechat_1_list'])) echo htmlspecialcharsFix($row['wechat_1_list']) . '
'; if (!empty($row['wechat_2_list'])) echo htmlspecialcharsFix($row['wechat_2_list']) . '
'; if (!empty($row['wechat_3_list'])) echo htmlspecialcharsFix($row['wechat_3_list']); echo '
'; echo '
'; if (!empty($row['linkedin_1_list'])) echo htmlspecialcharsFix($row['linkedin_1_list']) . '
'; if (!empty($row['linkedin_2_list'])) echo htmlspecialcharsFix($row['linkedin_2_list']) . '
'; if (!empty($row['linkedin_3_list'])) echo htmlspecialcharsFix($row['linkedin_3_list']); echo '
'; echo ''; echo '
'; if (!empty($row['alibaba_1_list'])) echo htmlspecialcharsFix($row['alibaba_1_list']) . '
'; if (!empty($row['alibaba_2_list'])) echo htmlspecialcharsFix($row['alibaba_2_list']) . '
'; if (!empty($row['alibaba_3_list'])) echo htmlspecialcharsFix($row['alibaba_3_list']); echo '
'; ?>
备注
Sorry,当前暂无信息
Sorry,没有找到""相关的信息,点击返回
1) { $pageName = "?Keys=" . $keys . $urlStr . "&"; $pagelen = 3; if ($page > 1) { echo "首页"; echo "上一页"; } if ($pagelen * 2 + 1 >= $totalPages) { $startPage = 1; $endPage = $totalPages; } else { if ($page <= $pagelen + 1) { $startPage = 1; $endPage = $pagelen * 2 + 1; } else { $startPage = $page - $pagelen; $endPage = $page + $pagelen; } if ($page + $pagelen > $totalPages) { $startPage = $totalPages - $pagelen * 2; $endPage = $totalPages; } } for ($i = $startPage; $i <= $endPage; $i++) { if ($i == $page) { echo "{$i}"; } else { echo "{$i}"; } } if ($page < $totalPages) { if ($totalPages - $page > $pagelen) { echo "...{$totalPages}"; } echo "下一页"; echo "尾页"; } echo ""; } ?>