<?php
class ApiTradesSoldGet {
public function getTradesSoldData($page, $sessionKey) {
//导入配置文件
$commConfig = include_once "config/config.php";
$c = new TopClient;
$c->appkey = $commConfig["appKey"];
$c->secretKey = $commConfig["appSecret"];
//$c->format = "json";
//返回数据使用 JSON 格式,默认为xml
$req = new TradesSoldGetRequest;
//设置查询项目
$req->setFields("tid,created,num_iid,orders.title,orders.pic_path,status,buyer_nick,receiver_name,receiver_city,receiver_mobile,receiver_phone,consign_time");
$req->setPageNo($page);
//默认为第一页
$req->setPageSize($commConfig["pageCount"]);
//默认为40
//$req->setUseHasNext("true");
//此项开启后,显示是否有下一页。有的话返回true。开启后不返回total_result
$resp = $c->execute($req, $sessionKey);
return $resp;
//返回结果
}
}
?>
返回结果后,前端通过jquery解析。推荐返回数据格式json