Commit 06afd62d authored by shajiaiming's avatar shajiaiming

优化

parent 819aeff9
...@@ -116,29 +116,28 @@ class WalletController extends BaseController ...@@ -116,29 +116,28 @@ class WalletController extends BaseController
$token = Yii::$app->request->get('address', ''); $token = Yii::$app->request->get('address', '');
$symbol = Yii::$app->request->get('symbol', ''); $symbol = Yii::$app->request->get('symbol', '');
if (empty($platform_id) || empty($token) || empty($symbol)) { if (empty($platform_id) || empty($token) || empty($symbol)) {
$msg = '参数不能为空'; $this->msg = '参数不能为空';
$code = -1; $this->code = -1;
$data = null;
goto doEnd; goto doEnd;
} }
$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 = '此功能为付费功能,有兴趣请与销售联系'; $this->msg = '此功能为付费功能,有兴趣请与销售联系';
$code = -1; $this->code = -1;
goto doEnd; goto doEnd;
} }
$platform = CoinPlatformWithHold::find()->select('exer, platform')->where(['id' => $chain_model->chain_id])->one(); $platform = CoinPlatformWithHold::find()->select('exer, platform')->where(['id' => $chain_model->chain_id])->one();
if (empty($platform)) { if (empty($platform)) {
$msg = '此功能为付费功能,有兴趣请与销售联系'; $this->msg = '此功能为付费功能,有兴趣请与销售联系';
$code = -1; $this->code = -1;
goto doEnd; goto doEnd;
} }
$node = Yii::$app->params['chain_nodes'][strtoupper($platform->platform)]; $node = Yii::$app->params['chain_nodes'][strtoupper($platform->platform)] ?? null;
if (empty($node)) { if (empty($node)) {
$msg = '此功能为付费功能,有兴趣请与销售联系'; $this->msg = '此功能为付费功能,有兴趣请与销售联系';
$code = -1; $this->code = -1;
goto doEnd; goto doEnd;
} }
...@@ -170,14 +169,13 @@ class WalletController extends BaseController ...@@ -170,14 +169,13 @@ class WalletController extends BaseController
} }
if (0 !== $result['code']) { if (0 !== $result['code']) {
$msg = '当前发币人数过多,请客官稍后再试'; $this->msg = '当前发币人数过多,请客官稍后再试';
$code = -1; $this->code = -1;
$data = null;
goto doEnd; goto doEnd;
} }
$data = $result['result']; $this->data = $result['result'];
doEnd : doEnd :
return ['code' => $code, 'data' => $data, 'msg' => $msg]; return ['code' => $this->code, 'data' => $this->data, 'msg' => $this->msg];
} }
public function actionTransfer() public function actionTransfer()
......
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