我收到错误消息:尝试获取非对象的属性。我完全不知道为什么会出现此错误。错误是针对这一行的:$results = $quotes->return;
感谢任何帮助。谢谢你。代码如下。
public function ajax_get_chart_litecoin() {
$quotes = $this->rest->get('api/2/ltc_usd/trades/fetch');
$series_data = array();
$results = $quotes->return;
foreach ($results as $quote)
{
$series_tmp = array(
'date' => $quote->date,
'price' => $quote->price
);
$series_data[] = $series_tmp;
}
$series_data = array_slice($series_data, 0, 10);
return json_encode($series_data);
}