Commit a16e6af6 authored by shajiaiming's avatar shajiaiming

fix

parent 1583468c
...@@ -198,12 +198,15 @@ class WalletChainController extends BaseController ...@@ -198,12 +198,15 @@ class WalletChainController extends BaseController
public function syncCoin($params = []) public function syncCoin($params = [])
{ {
$model = new Coin(); $model_coin = Coin::find()->where(['name' => $params['token'], 'platform' => $params['platform'], 'chain' => 'BTY'])->one();
$model->nickname = ['ja' => '', 'en-US' => '', 'zh-CN' => '']; if (empty($model_coin)) {
$model->name = $params['token']; $model = new Coin();
$model->platform = $params['platform']; $model->nickname = ['ja' => '', 'en-US' => '', 'zh-CN' => ''];
$model->chain = 'BTY'; $model->name = $params['token'];
$model->platform_id = 1; $model->platform = $params['platform'];
$model->save(); $model->chain = 'BTY';
$model->platform_id = 1;
$model->save();
}
} }
} }
\ No newline at end of file
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