您现在的位置是:首页 > 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内核精心开发,为机械设备与工业产品制造企业量身打造。设计充分考量行业特性,突出产品展示与技术实力呈现查看源码
  • html5响应式pbootcms模板新闻资讯博客网站源码该模板采用PbootCMS内核开发,专为新闻资讯类网站打造,同时具备高度行业适配性--只需替换图文内容即可快速转型为企业官网、行业门户等各类站点。查看源码
  • (自适应响应式)环保净化器家用电器网站免费模板针对环保设备、环境监测等领域的PbootCMS响应式模板,通过模块化设计清晰展示污水处理技术、空气净化系统等解决方案。移动端呈现环保数据可视化图表,后端统一管理确保项目案例、技术等资料多端同步。查看源码
  • 帝国cms7.5大型游戏资讯门户网站源码免费下载本模板基于帝国CMS7.5内核开发,为大型游戏资讯门户网站设计。模板自带响应式手机版,适配多种终端设备。内容架构针对游戏行业特点优化,支持游戏资讯、评测、攻略等内容类型的发布与管理。查看源码
  • 自适应恒温恒湿机空调机械设备营销型网站模板(自适应手机版)响应式营销型恒温恒湿机环境设备类网站pbootcms模板 蓝色营销型空调设备网站源码下载PbootCMS内核开发的网站模板,该模板适用于营查看源码
  • (PC+WAP)蓝色玻璃纤维制品环保设备营销型pbootcms模板源码下载这是一款针对玻璃纤维行业特点设计的网站模板,采用蓝色系配色方案,体现工业感和环保理念。模板包含产品中心、应用案例、技术支持和新闻动态等核心模块,能够全面展示玻璃纤维制品的技术参数和应用场景。查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐