我使用带有结算 ID 的 GetReport 创建了一个页面。
到目前为止,我能够从亚马逊卖家那里获得数据,但我正试图弄清楚如何将报告变成一张整洁的表格。
这是我的代码:
function invokeGetReport(MarketplaceWebService_Interface $service, $request) {
try {
$response = $service->getReport($request);
echo ("<table class='table table-bordered table-striped table-hover table-condensed table-responsive'>\n");
echo ("<thead>");
echo ("<tr> ");
echo ("<th >Settlement ID</th> ");
echo ("<td>");
echo ("Settlement ID Report display here");
echo ("</td></tr>");
echo ("<tr> ");
echo ("<th>GetReportResponse\n</th> ");
echo ("<td>");
if ($response->isSetGetReportResult()) {
$getReportResult = $response->getGetReportResult();
echo (" GetReport");
echo ("</td></tr>");
}
//Report Content
echo ("<tr> ");
echo ("<th>Settlement ID</th> ");
echo ("<td>");
echo (stream_get_contents($request->getReport()) . "\n");
echo ("</td></tr>");
} catch (MarketplaceWebService_Exception $ex) {
echo("Caught Exception: " . $ex->getMessage() . "\n");
echo("Response Status Code: " . $ex->getStatusCode() . "\n");
echo("Error Code: " . $ex->getErrorCode() . "\n");
echo("Error Type: " . $ex->getErrorType() . "\n");
echo("Request ID: " . $ex->getRequestId() . "\n");
echo("XML: " . $ex->getXML() . "\n");
echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
echo ("</td></tr>");
echo ("</table>\n");
}
}
如你看到的:
stream_get_contents($request->getReport())
是我提取结算报告的地方,但是,我想getReport()
在一个整洁的表格中细分为更多细节,目前它看起来像这样
我希望有更多这样的