国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > DedeCMS > ecshop网店系统集成亿起发cps接口的方法

ecshop网店系统集成亿起发cps接口的方法

来源:程序员人生   发布时间:2014-04-30 11:43:51 阅读次数:2178次
为了帮助一个电子商务界朋友,最近做了个亿起发的cps接口,放在ecshop2.7.0里面。应一些朋友的邀请,我还是把程序,接口文件。一起和大家分享。

1) wid 网站主站点ID
2) fbt 反馈标签(网站主网站注册会员的ID,)
3) order_time 订单时间(精确时间。格式:yyyy-mm-dd hh:mm:ss)
4) order_no 订单编号
5) order_product_id 产品分类编号
6) order_product_name 产品名称(可选)
7) order_product_no 产品编号
8) order_amount 订单个数(传1)
9) order_money 订单总金额(去掉运费)

以上就是他的接口参数了,他不需要将数据提交到他们系统里面。

1:首先,从广告位置传递这么几个参数过来。?cid=11&wid=102&fbt=sdfgag&url=http://www.shopy.cn/shopy64.html

你将用$_GET方式传递过来,在index.php页面,接受这些参数

if(isset($_GET['cid'])&&$_GET['cid']!=''){

if(!isset($_SESSOIN['cid']) ){

$_SESSION['cid']= $_GET['cid'];

}
}
if(isset($_GET['fbt'])&&$_GET['fbt']!=''){

if(!isset($_SESSOIN['fbt'])){
$_SESSION['fbt']= $_GET['fbt'];

}
}
if(isset($_GET['wid'])&&$_GET['wid']!=''){
if(!isset($_SESSOIN['wid'])){
$_SESSION['wid'] = $_GET['wid'];
}
}

修改数据库order_info,增加这几个字段,把这几个字段写到数据库中。在定单生成的时候。

做一个query.php通过D=20090716时间格式,查询当天交易的定单。

define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');

if ((DEBUG_MODE & 2) != 2)
{
$smarty->caching = true;
}
$string1 = "[QUERY]";
if(isset($_GET['D']) && $_GET['D']!=''){

$re = $db -> getAll("select o.* from ".$ecs->table('order_info')." as o where o.wid!='' and order_sn like '%".addslashes(trim($_GET['D']))."%'");
foreach ($re as $k=>$v){
$string.=$v['wid'];
$string.="||".local_date("Y-m-d H:i:s",$v['1247544128']);
$string.="||".$v['order_sn'];
$string.="||";
$string.="||";
$string.="||";
$string.="||1";
$string.="||".($v['goods_amount']-$v['discount']);
$string.="||".$v['fbt'];
$ar[] = $string;
$string="";
}
$string2="[/QUERY]";
if($ar){
echo $string1.join("|_|",$ar).$string2;
}
}
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生