您现在的位置是:首页 > 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企业网站模板(自适应手机版)响应式电梯扶梯类pbootcms模板 电梯生产企业绿色企业网站源码下载PbootCMS内核开发的网站模板,该模板适用于电梯、扶梯类等企业,查看源码
  • (自适应响应式)瓷砖大理石装修建材类网站pbootcms模板html5模板本模板基于PbootCMS开发,针对瓷砖、大理石等建材行业特点进行优化设计。采用响应式布局技术,确保产品展示效果在不同设备上都能合理呈现。模板特别强化了石材纹理的视觉表现力,帮助建材企业更好地展示产品质感。查看源码
  • 帝国CMS游戏应用APP推广下载站模板免费下载本模板为移动应用推广、手机游戏推广行业设计,集成H5游戏平台与APP下载功能,支持PC端与移动端自适应访问。专注于为应用开发商、游戏发行商提供专业的线上推广展示平台。查看源码
  • (自适应)绿色农业大型机械设备展示网站模板下载基于PbootCMS内核深度定制开发的农业机械行业专用模板。针对农机设备展示、产品参数说明等需求优化设计,突出农业机械行业特性查看源码
  • (自适应响应式)HTML5电脑手机电子数码产品配件pbootcms模板下载本模板为电脑配件、手机配件及数码周边产品企业设计,基于PbootCMS内核开发。采用现代化响应式布局,适配各类移动设备,能够专业展示各类电子产品配件参数、应用场景和技术特点。模板内置多种产品展示模块,满足不同类型配件企业的展示需求。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐