Commit 61a5fbe4 authored by shajiaiming's avatar shajiaiming

fix

parent cdc890c4
......@@ -100,26 +100,27 @@ class IssueChainController extends BaseController
public function actionSetCharge()
{
$data = null;
$platform_id = Yii::$app->request->getPlatformId();
$result = Yii::$app->request->post();
$group = Yii::$app->request->getGroup();
if ('administrator' == $group) {
$platform_id = isset($result['platform_id']) ? (int)$result['platform_id'] : 0;
} else {
$platform_id = Yii::$app->request->getPlatformId();
}
$issue_charge = isset($result['issue_charge']) ? $result['issue_charge'] : '';
$charge_unit = isset($result['charge_unit']) ? strtoupper($result['charge_unit']) : '';
$id = isset($result['platform_id']) ? (int)$result['platform_id'] : 0;
if (false == $issue_charge || false == $charge_unit) {
if (false == $issue_charge || false == $charge_unit || false == $platform_id) {
$msg = '提交数据有误';
$code = -1;
goto doEnd;
}
if (1 == $platform_id) {
$platform_id = $id;
}
$chain_model = CoinPlatform::find()->where(['id' => $platform_id])->one();
if (false == $chain_model) {
$msg = '不存在的链';
$msg = '数据不存在';
$code = -1;
goto doEnd;
}
......@@ -146,8 +147,8 @@ class IssueChainController extends BaseController
public function actionManageReview()
{
$data = null;
$platform_id = Yii::$app->request->getPlatformId();
if (1 != $platform_id) {
$group = Yii::$app->request->getGroup();
if ('administrator' == $group) {
$msg = '当前账户无权限操作';
$code = -1;
goto doEnd;
......@@ -176,34 +177,38 @@ class IssueChainController extends BaseController
{
$data = null;
$group = Yii::$app->request->getGroup();
// if ('administrator' == $group) {
// $chains = array_keys(Yii::$app->params['chain_nodes']);
// $platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['in', 'platform', $chains])->all();
// } else {
// $platform_id = Yii::$app->request->getPlatformId();
// $chain_model = CoinPlatform::find()->select('chain_id')->where(['id' => $platform_id])->andWhere(['<>', 'chain_id', 0])->one();
// $platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['id' => $chain_model->chain_id])->all();
// }
$platform_id = Yii::$app->request->getPlatformId();
$chain_model = CoinPlatform::find()->select('chain_id')->where(['id' => $platform_id])->andWhere(['<>', 'chain_id', 0])->one();
if (empty($chain_model)) {
$msg = '此功能为付费功能,有兴趣请与销售联系';
$code = -1;
goto doEnd;
}
$platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['id' => $chain_model->chain_id])->all();
if (empty($platform)) {
$msg = '此功能为付费功能,有兴趣请与销售联系';
$code = -1;
goto doEnd;
if ('administrator' == $group) {
$chains = array_keys(Yii::$app->params['chain_nodes']);
$platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['in', 'platform', $chains])->all();
} else {
$platform_id = Yii::$app->request->getPlatformId();
$chain_model = CoinPlatform::find()->select('chain_id')->where(['id' => $platform_id])->andWhere(['<>', 'chain_id', 0])->one();
if (empty($chain_model)) {
$msg = '尚未开通此功能';
$code = -1;
goto doEnd;
}
$platform = CoinPlatformWithHold::find()->select('id, platform, exer')->where(['id' => $chain_model->chain_id])->one();
if (empty($platform)) {
$msg = '尚未开通此功能';
$code = -1;
goto doEnd;
}
if (!isset(Yii::$app->params['chain_nodes'][strtoupper($platform->platform)])) {
$msg = '尚未开通此功能';
$code = -1;
goto doEnd;
}
$platform = array($platform);
}
foreach ($platform as $val) {
$val->tokens = [];
if (!empty($val->exer)) {
$node = Yii::$app->params['chain_nodes'][strtoupper($val->platform)];
$service = new Chain33Service($node);
$funcName = 'GetTokens';
$result = $service->getTokens($val->exer, $funcName);
$result = $service->getTokens($val->exer, $funcName);
if (isset($result['code']) && 0 == $result['code']) {
$symbol = [];
foreach ($result['result']['tokens'] as $temp) {
......
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