Commit 04666181 authored by shajiaiming's avatar shajiaiming

fix

parent 4a3e3c0a
......@@ -33,11 +33,6 @@ class PlatformCoinsController extends BaseController
return ['code' => 0,'data' => null, 'msg' => '数据导入成功'];
}
$isExistModel = CoinPlatformCoins::find()->where(['deviceCode' => $deviceCode, 'platform_id' => $platform_id])->one();
if($isExistModel) {
return ['code' => -1,'data' => null, 'msg' => '数据重复插入'];
};
$item_array = [];
foreach($coins_address as $item){
$platform_coins_arr = explode(',', $item);
......@@ -45,11 +40,12 @@ class PlatformCoinsController extends BaseController
$coins_address = $platform_coins_arr[1];
if(empty($coin_name) || empty($coins_address)) continue;
$isExistModel = CoinPlatformCoins::find()->where(['coins_name' => $coin_name, 'coins_address' => $coins_address, 'platform_id' => $platform_id])->one();
if($isExistModel){
if(!empty($isExistModel) && empty($isExistModel->deviceCode)){
$isExistModel->deviceCode = $deviceCode;
$isExistModel->save();
continue;
}
if(!empty($isExistModel) && strlen($isExistModel->deviceCode) > 0) continue;
$item_array[] = [
$coin_name,
$coins_address,
......
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