request->getPlatformId(); 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() { $current_platform_id = Yii::$app->request->getPlatformId(); if(1 !== $current_platform_id) { $platform_id = $current_platform_id; } else { $platform_id = Yii::$app->request->get('platform_id', 1); } if(!isset(Yii::$app->params['trusteeship']['port'][$platform_id])){ return ['code' => -1, 'data' => [], 'msg' => '此钱包节点尚未开通']; } $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($node_params); $result = $service->getWalletBalance($params); if (200 !== $result['code']) { return ['code' => $result['code'], 'data' => [], 'msg' => $result['msg']]; } return ['code' => 1, 'data' => $result['msg'], 'msg' => 'success']; } public function actionUserAsset() { $platform_id = Yii::$app->request->getPlatformId(); $node_params = [ 'scheme' => Yii::$app->params['trusteeship']['scheme'], 'host' => Yii::$app->params['trusteeship']['host'], 'port' => Yii::$app->params['trusteeship']['port'][$platform_id] ]; $uid = Yii::$app->request->get('uid', ''); $params = [ 'uid' => $uid ]; $service = new TrusteeShipService($node_params); $result = $service->getUserAsset($params); if (200 !== $result['code']) { return ['code' => $result['code'], 'data' => [], 'msg' => $result['msg']]; } return ['code' => 1, 'data' => $result['msg'], 'msg' => 'success']; } }