Commit a5437286 authored by shajiaiming's avatar shajiaiming

托管钱包余额

parent 36230558
......@@ -18,20 +18,42 @@ class WalletController extends BaseController
*/
public function actionList()
{
$platforms = CoinPlatform::find()->asArray()->all();
$token_string = Yii::$app->request->headers->get('Token');
$user = Admin::findIdentityByAccessToken($token_string);
$platform_id = $user->platform_id;
if (1 === $platform_id) {
$platforms = CoinPlatform::find()->select('id, name')->asArray()->all();
} else {
$platforms = CoinPlatform::find()->select('id, name')->where(['id' => $platform_id])->asArray()->all();
}
return ['code' => 0, 'msg' => 'ok', 'data' => $platforms];
}
public function actionWalletBallance()
{
$token_string = Yii::$app->request->headers->get('Token');
$user = Admin::findIdentityByAccessToken($token_string);
$platform_id = $user->platform_id;
$node_params = [
'scheme' => Yii::$app->params['trusteeship']['scheme'],
'host' => Yii::$app->params['trusteeship']['host'],
'port' => Yii::$app->params['trusteeship']['port'][$platform_id]
];
$type = Yii::$app->request->get('type', 1);
$page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 15);
$currency = Yii::$app->request->get('currency ', '');
$params = [
'type' => $type,
'page' => $page,
'size' => $size,
'currency' => $currency
];
$service = new TrusteeShipService();
$service = new TrusteeShipService($node_params);
$result = $service->getWalletBalance($params);
return ['code' => 1, 'data' => $result, 'msg' => 'success'];
}
......
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