最土整合9赢cps接口

2011-06-23 16:50 来源:www.chinab4c.com 作者:ecshop专家

1:修改最土数据库

alter table `order` add column cps_type varchar(128) default  '';
alter table `order` add column cps_value varchar(128) default  '';
2:新建立cps接口文件

require_once(dirname(__FILE__) . '/app.php');

$u_id = $_REQUEST['uid'];

if (!empty($u_id))
 {
    setcookie('9ycps',$u_id,time()+3600*24*30);
 }
 if($url == ''){
 $url = 'index.php';
 }

header("Location:$url");
 

3:team/buy.php
$9ycps = $_COOKIE['9ycps'];
  if(isset($9ycps)){
   Table::UpdateCache('order',$order_id,array('cps_type'=>'9ycps'));
   Table::UpdateCache('order',$order_id,array('cps_value'=>$9ycps));
  }

 

4:增加查询接口

require_once(dirname(__FILE__) . '/app.php');
$condition['cps_type'] = '9ycps';
$orders = DB::LimitQuery('order', array(
 'condition' => $condition,
 'order' => 'ORDER BY team_id DESC, id ASC',
 
));

$team_ids = Utility::GetColumn($orders, 'team_id');
$teams = Table::Fetch('team', $team_ids);
foreach($teams AS $tid=>$one){
 team_state($one);
 $teams[$tid] = $one;
}