Commit 6e3810bd authored by ZhuChunYang's avatar ZhuChunYang

etc行情添加

parent 70a73eb4
......@@ -49,6 +49,14 @@ class ServiceController extends BaseController
$exchange = ExchangeFactory::createExchange('HuoBi');
if ($exchange->symbolExists($item)) {
$quotation = $exchange->getTicker($item);
if($quotation){
//格式化行情数据
foreach ($quotation as $key => $value) {
$quotation[$key] = (float)sprintf("%0.4f", (double)$value);
}
$rate = $this->getRate();
$quotation['rmb'] = (float)sprintf("%0.2f", $rate * $quotation['last']);
}
}
}else{
$quotation = ExchangeBusiness::getquatation($item);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment