Commit 61a5fbe4 authored by shajiaiming's avatar shajiaiming

fix

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