ecshop網(wǎng)店系統(tǒng)集成億起發(fā)cps接口的方法
來源:程序員人生 發(fā)布時(shí)間:2014-04-30 11:43:51 閱讀次數(shù):2547次
為了幫助一個(gè)電子商務(wù)界朋友,最近做了個(gè)億起發(fā)的cps接口,放在ecshop2.7.0里面。應(yīng)一些朋友的邀請(qǐng),我還是把程序,接口文件。一起和大家分享。
1) wid 網(wǎng)站主站點(diǎn)ID
2) fbt 反饋標(biāo)簽(網(wǎng)站主網(wǎng)站注冊(cè)會(huì)員的ID,)
3) order_time 訂單時(shí)間(精確時(shí)間。格式:yyyy-mm-dd hh:mm:ss)
4) order_no 訂單編號(hào)
5) order_product_id 產(chǎn)品分類編號(hào)
6) order_product_name 產(chǎn)品名稱(可選)
7) order_product_no 產(chǎn)品編號(hào)
8) order_amount 訂單個(gè)數(shù)(傳1)
9) order_money 訂單總金額(去掉運(yùn)費(fèi))
以上就是他的接口參數(shù)了,他不需要將數(shù)據(jù)提交到他們系統(tǒng)里面。
1:首先,從廣告位置傳遞這么幾個(gè)參數(shù)過來。?cid=11&wid=102&fbt=sdfgag&url=http://www.shopy.cn/shopy64.html
你將用$_GET方式傳遞過來,在index.php頁(yè)面,接受這些參數(shù)
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'];
}
}
修改數(shù)據(jù)庫(kù)order_info,增加這幾個(gè)字段,把這幾個(gè)字段寫到數(shù)據(jù)庫(kù)中。在定單生成的時(shí)候。
做一個(gè)query.php通過D=20090716時(shí)間格式,查詢當(dāng)天交易的定單。
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;
}
}
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)