作者 karlet

feat:修复k线获取

@@ -298,9 +298,12 @@ class CmBroker @@ -298,9 +298,12 @@ class CmBroker
298 { 298 {
299 $symbolOri = $this->getSymbolOri($symbol, $this->plat); 299 $symbolOri = $this->getSymbolOri($symbol, $this->plat);
300 if ($this->plat == 'okx') { 300 if ($this->plat == 'okx') {
301 - $klines = $this->exBroker->getKlines($symbolOri, $peroid, $limit); 301 + $res = $this->exBroker->getKlines($symbolOri, $peroid, $limit);
  302 + if ($res['code'] != '0') {
  303 + return [];
  304 + }
302 $newKlines = []; 305 $newKlines = [];
303 - foreach ($klines as $key => $value) { 306 + foreach ($res['data'] as $key => $value) {
304 $kline = Kline::transferOkx($value); 307 $kline = Kline::transferOkx($value);
305 $newKlines[] = $kline; 308 $newKlines[] = $kline;
306 } 309 }