Commit 5e4bd1d5 authored by rlgy's avatar rlgy

搜索币api v2

parent 9626c654
...@@ -31,7 +31,10 @@ class CoinController extends BaseController ...@@ -31,7 +31,10 @@ class CoinController extends BaseController
$request = Yii::$app->request; $request = Yii::$app->request;
$id = $request->post('id', 0); $id = $request->post('id', 0);
if ($id) { if ($id) {
return CoinBusiness::getCoinAllById($id); $ret = CoinBusiness::getCoinAllById($id);
if ($ret) {
return $ret[0];
}
} }
return []; return [];
} }
...@@ -67,7 +70,7 @@ class CoinController extends BaseController ...@@ -67,7 +70,7 @@ class CoinController extends BaseController
//如果coin为null,$coin->minerFee会抛出Trying to get property 'minerFee' of non-object",code=>8 //如果coin为null,$coin->minerFee会抛出Trying to get property 'minerFee' of non-object",code=>8
throw new Exception('8', '币种不存在'); throw new Exception('8', '币种不存在');
} }
return [$miner_fee]; return (array)$miner_fee->getAttributes();
} }
/** /**
......
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