ecshop網店系統集成億起發cps接口的方法
來源:程序員人生 發布時間:2014-04-30 11:43:51 閱讀次數:2557次
為了幫助一個電子商務界朋友,最近做了個億起發的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;
}
}
生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈