Commit ae8c36ef authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into develop

parents 0c09b0eb 0e41c85a
...@@ -273,17 +273,16 @@ class CoinController extends BaseController ...@@ -273,17 +273,16 @@ class CoinController extends BaseController
public function actionSearch() public function actionSearch()
{ {
$count = 0;
$params = Yii::$app->request->post(); $params = Yii::$app->request->post();
$chain = isset($params['chain']) ? $params['chain'] : ''; $chain = isset($params['chain']) ? $params['chain'] : '';
$keyword = isset($params['keyword']) ? $params['keyword'] : ''; $keyword = isset($params['keyword']) ? $params['keyword'] : '';
$platform = isset($params['platform']) ? $params['platform'] : '';
$platform_id = isset($params['platform_id']) ? $params['platform_id'] : ''; $platform_id = isset($params['platform_id']) ? $params['platform_id'] : '';
$page = empty($params['page']) ? 1 : $params['page']; $page = empty($params['page']) ? 1 : $params['page'];
$limit = empty($params['limit']) ? 10 : $params['limit']; $limit = empty($params['limit']) ? 10 : $params['limit'];
if (false == $platform_id) { if (false == $platform_id) {
$msg = '参数错误';
$code = -1; $code = -1;
$data = null; $data = null;
goto doEnd; goto doEnd;
...@@ -298,10 +297,6 @@ class CoinController extends BaseController ...@@ -298,10 +297,6 @@ class CoinController extends BaseController
$query->andWhere(['chain' => $chain]); $query->andWhere(['chain' => $chain]);
} }
if (false != $platform) {
$query->andWhere(['platform' => $platform]);
}
if (false != $keyword) { if (false != $keyword) {
$query->andWhere(['or', ['like', 'address', $keyword], ['like', 'name', $keyword]]); $query->andWhere(['or', ['like', 'address', $keyword], ['like', 'name', $keyword]]);
} }
......
...@@ -113,6 +113,13 @@ class TrusteeShipService ...@@ -113,6 +113,13 @@ class TrusteeShipService
return $this->send("POST", $uri, $params); return $this->send("POST", $uri, $params);
} }
public function coinList($params = [])
{
$uri = '/backend/coin/coin-list';
return $this->send("GET", $uri, $params);
}
public function getUserAsset($params = []) public function getUserAsset($params = [])
{ {
$uri = 'backend/user/asset'; $uri = 'backend/user/asset';
......
...@@ -301,4 +301,50 @@ class FlashController extends BaseController ...@@ -301,4 +301,50 @@ class FlashController extends BaseController
return ['code' => $code, 'msg' => $msg, 'data' => $data]; return ['code' => $code, 'msg' => $msg, 'data' => $data];
} }
function actionIndex()
{
$msg = 'success';
$code = 0;
$data = null;
$group = Yii::$app->request->getGroup();
$platform_id = Yii::$app->request->get('platform_id', 0);
if (User::AUTH_SUPER !== $group && $platform_id != Yii::$app->request->getPlatformId()) {
$msg = '暂无权限';
$code = -1;
goto doEnd;
}
if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通'];
}
$node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$params = [];
$time = time();
$appKey = isset($node_params['appKey']) ? $node_params['appKey'] : null;
$appSecret = isset($node_params['appSecret']) ? $node_params['appSecret'] : null;
$signature = self::getSign($params, $appKey, $appSecret, $time);
$headers = [
'FZM-Wallet-Signature' => $signature,
'FZM-Wallet-Timestamp' => $time,
'FZM-Wallet-AppKey' => $appKey,
'FZM-Wallet-AppIp' => Yii::$app->request->userIP
];
$service = new TrusteeShipService($node_params, $headers);
$result = $service->coinList($params);
if (200 !== $result['code']) {
$msg = $result['msg'];
$code = -1;
goto doEnd;
}
$data = $result['msg'];
doEnd :
return ['code' => $code, 'msg' => $msg, 'data' => $data];
}
} }
\ No newline at end of file
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