cps 亿玛广告联盟 查询接口

2016-07-07 15:01 来源:www.chinab4c.com 作者:ecshop专家

<?php
header('Content-Type: text/html; charset=utf-8');
define('IN_ECS', true);
require($_SERVER['DOCUMENT_ROOT']. '/includes/init.php');

//获得日期进行处理
$d = $_GET['d'];
if(strpos($d,'-')){
$d_arr = explode('-',$d);
if(strlen($d_arr['0'])==4&&strlen($d_arr['1'])==2&&strlen($d_arr['2'])==2){
$min = mktime('0','0','0',$d_arr['1'],$d_arr['2'],$d_arr['0'])-28800;
$max = mktime('0','0','0',$d_arr['1'],$d_arr['2']+1,$d_arr['0'])-28800;
}else{exit('日期格式错误');}
}else{
$d = intval($d); $Y = substr($d,0,4); $M = substr($d,4,2); $D = substr($d,6,2);
if(strlen($Y)==4&&strlen($M)==2&&strlen($D)==2){
$min = mktime('0','0','0',$M,$D,$Y)-28800;
$max = mktime('0','0','0',$M,$D+1,$Y)-28800;
}else{exit('日期格式错误');}
}

//根据日期筛选订单
$sql = 'SELECT order_sn,add_time,goods_amount,cps_extension FROM '.$GLOBALS['ecs']->table('order_info')." WHERE from_ad=48 and add_time>$min and add_time<$max";
$order_info = $GLOBALS['db']->getAll($sql);
if($order_info){
foreach($order_info as $key=>$val){
echo $val['cps_extension'].'||'.date('Y-m-d H:i:s',$val['add_time']+28800).'||'.$val['order_sn'].'||'.$val['goods_amount'].'<BR>';
}
}
?>

回答:
路过,顶一下!

支持一下

看不懂!

路过看看。。。。