您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程

ecshop后台订单实现精准统计

痴珊2023-12-03Ecshop商城教程已有人查阅

导读显示IP,来源网站等信息,通过这些信息能帮助你更好的掌握潜在客户的来源与分布,为精准营销提供条件

显示IP,来源网站等信息,通过这些信息能帮助你更好的掌握潜在客户的来源与分布,为精准营销提供条件
修改文件:/languages/zh_cn/admin/common.php,添加如下代码:
$_LANG['order_tongji'] = ’订单统计’;
修改文件:/admin/includes/inc_menu.php,添加
/* 二次开发 订单统计 */
$modules['06_stats']['order_tongji'] = ’order_tongji.php?act=list’; 
创建文件:/admin/order_tongji.php
<?php
define(‘IN_ECS’, true);   require(dirname(__FILE__) . ’/includes/init.php’); require(dirname(__FILE__) . ’/includes/cls_page.php’);
/*—————————————————— */ /*—————————————————— */
if ($_REQUEST['act'] == ’list’) {   $sql=urlencode(“SELECT * FROM ” .$ecs->table(‘tongji’).“ as t right join ” .$ecs->table(‘order_info’).“ as i on t.order_sn=i.order_sn order by tongji_id desc”);   $pclass=new Page($sql,20,10,“”,“”,“”,“”); $pclass->SetPagePara(“par”,“paravalue”); $pclass->ShowList($_GET["startpage"],$_GET["t"],$_GET["offset"],“order_tongji.php”,“act=list”); $i=’1′;   $html = ”; while($row=mysql_fetch_row($pclass->Result)) { $html .= ’<tr>’; $html .= ’<td>’.$row[0].’</td>’; $html .= ’<td>’.$row[1].’</td>’; $html .= ’<td>’.$row[2].’</td>’; $html .= ’<td>’.date(‘Y-m-d H:i:s’,$row[4]+28800).’</td>’; $html .= ’<td>’.$row[6].’</td>’; $html .= ’<td>’.$row[5].’</td>’; $html .= ’<td>’.$row[7].’</td>’; $html .= ’<td>’.$row[8].’</td>’; $html .= ’</tr>’; }
$smarty->assign(‘page’, $pclass->OutPut); $smarty->assign(‘content’, $html); $smarty->display(‘tongji.htm’); } ?>
创建文件:/admin/templates/tongji.htm
{include file=“pageheader.htm”}
 <div class=“list-div” id=“listDiv”> <table width=“ ” border=“0″ cellpadding=“3″ cellspacing=“1″>
 <tr> <th>编号</th> <th>订单号</th> <th>收货人</th> <th>下单时间</th> <th>ip</th> <th>来源网站</th> <th>来源URL</th> <th>受访URL</th> </tr> {$content} <tr><td colspan=“8″ align=“center”><BR>{$page}</td></tr> </table> </div> {include file=“pagefooter.htm”}
修改文件 /flow.php 1246行左右,添加如下代码
if(isset($_COOKIE['request_info'])){ $request_info = unserialize(strtr($_COOKIE['request_info'],array(“\”=>”“))); $sql = ”INSERT INTO “.$ecs->table(‘tongji’).”(order_sn, user_name,start_time,end_time,host,ip,start_url,end_url) value(‘“.$order['order_sn'].”‘,’“.$order['c**ignee'].”‘,’“.$request_info['time'].”‘,’“.gmtime().”‘,’“.$request_info['host'].”‘,’“.$_SERVER['REMOTE_ADDR'].”‘,’“.$request_info['start_url'].”‘,’“.$request_info['end_url'].”‘)“; }else{ $sql = ”INSERT INTO “.$ecs->table(‘tongji’).”(order_sn, user_name,start_time,end_time,host,ip,start_url,end_url) value(‘“.$order['order_sn'].”‘,’“.$order['c**ignee'].”‘,’“.gmtime().”‘,’“.gmtime().”‘,’本站’,’“.$_SERVER['REMOTE_ADDR'].”‘,’本站’,'本站’)”; } $db->query($sql);
修改文件 include/init.php,添加
/* 记录请求信息 */ function request_info(){ $start_url = $_SERVER['HTTP_REFERER']; //来源网站 $start_url_info = parse_url($start_url); if($start_url_info['host']!=$_SERVER['SERVER_NAME'] && $start_url_info['host']!=”){ $request_info = array(); $request_info['host'] = $start_url_info['host']; //域名 $request_info['time'] = gmtime(); //时间 $request_info['start_url'] = $start_url; //时间 $request_info['end_url'] = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; //被访页面 setcookie(‘request_info’, serialize($request_info), time()+86400, “/”); } } request_info();

本文标签:

很赞哦! ()

相关源码

  • (自适应)品牌策划高端设计公司网站pbootcms模板免费下载本模板为品牌策划与设计公司打造,基于PbootCMS内核开发,充分考虑了创意设计行业的视觉展示需求。模板设计风格现代简约,布局合理清晰,呈现设计作品与专业服务,帮助设计公司展示创意实力并吸引潜在客户。查看源码
  • (PC+WAP)绿色市政园林建筑设计绿化营销型pbootcms网站模板本模板基于PbootCMS系统开发,为园林绿化、景观设计类企业设计,特别适合市政园林、景观工程、绿化养护等企业使用。采用双端适配技术查看源码
  • (自适应)WordPress主题SEO自媒体博客资讯模板RabbitV2.0Rabbit v2.0主题专注于网站搜索引擎优化需求,为博客、自媒体及资讯类网站提供专业的SEO技术解决方案。该主题从架构设计到功能实现均围绕搜索引擎优化理念展开。查看源码
  • 工商注册财务代理记账类自适应pbootcms网站工商注册、财务代理记账企业打造的数字化门户模板,基于PbootCMS内核深度开发。采用前沿响应式架构,无缝适配手机端触控交互与PC端展示需求查看源码
  • (自适应)绿色园林建筑花卉园艺艺术模板免费下载为景观设计及园艺企业打造的响应式网站框架,基于PbootCMS系统开发,帮助传统园林行业建立现代化数字展示平台。采用标准DIV+CSS前端架构,代码精简无冗余。查看源码
  • (自适应)蓝色五金制品配件管件pbootcms网站源码下载基于PbootCMS内核开发的五金行业专用模板,采用响应式设计架构,确保产品展示在各类移动设备上的呈现。通过模块化布局与工业风视觉设计,帮助五金企业高效展示产品规格、应用场景及技术支持,建立专业可靠的行业形象。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐