Commit d82c2476 authored by shajiaiming's avatar shajiaiming

add return column

parent 7e653cc9
...@@ -271,20 +271,20 @@ class ExchangeBusiness ...@@ -271,20 +271,20 @@ class ExchangeBusiness
if (count($condition[0]) > 1) { if (count($condition[0]) > 1) {
foreach ($condition as $val) { foreach ($condition as $val) {
if ('null' == $val[1] || 'coin' == $val[1]) { if ('null' == $val[1] || 'coin' == $val[1]) {
$data[] = Coin::find()->select('id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty') $data[] = Coin::find()->select('id,sid,icon,name,optional_name,nickname,introduce,platform,chain,address as contract_address,treaty')
->where(['name' => $val[0]]) ->where(['name' => $val[0]])
->asArray() ->asArray()
->one(); ->one();
continue; continue;
} }
$data[] = Coin::find()->select('id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty') $data[] = Coin::find()->select('id,sid,icon,name,optional_name,nickname,introduce,platform,chain,address as contract_address,treaty')
->where(['name' => $val[0]]) ->where(['name' => $val[0]])
->andWhere(['platform' => $val[1]]) ->andWhere(['platform' => $val[1]])
->asArray() ->asArray()
->one(); ->one();
} }
} else { } else {
$data = Coin::find()->select('id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty') $data = Coin::find()->select('id,sid,icon,name,optional_name,nickname,introduce,platform,chain,address as contract_address,treaty')
->where(['in', 'name', $condition]) ->where(['in', 'name', $condition])
->asArray()->all(); ->asArray()->all();
} }
......
...@@ -62,11 +62,11 @@ class CoinController extends BaseController ...@@ -62,11 +62,11 @@ class CoinController extends BaseController
$names = [$names]; $names = [$names];
} }
$condition = $names; $condition = $names;
$fields = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain','address as contract_address','introduce']; $fields = ['id', 'sid', 'icon', 'name', 'nickname', 'platform', 'chain', 'address as contract_address', 'introduce'];
$result = ExchangeBusiness::getApiListForIndex(1, 999, $condition,$fields); $result = ExchangeBusiness::getApiListForIndex(1, 999, $condition, $fields);
if ($result) { if ($result) {
$response_->build(ResponseBuild::STATUS_SUCCEED, '', $result['data']); $response_->build(ResponseBuild::STATUS_SUCCEED, '', $result['data']);
}else{ } else {
$response_->build(ResponseBuild::STATUS_SUCCEED, '', []); $response_->build(ResponseBuild::STATUS_SUCCEED, '', []);
} }
return $response_; return $response_;
......
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