<?php
require __DIR__ . '/../../vendor/autoload.php';

use think\App;
use \think\facade\Db;
use app\model\GameModel;

$app = App::getInstance();
$app->initialize();

$games = Db::connect('fortue_tiger')->table('tp_game_list')->where('id', '>', 0)->select()->toArray();
if ($games)
{
    foreach ($games as $game)
    {
        if (GameModel::checkGameIdExists(10000, $game['game_id'])) {
            continue;
        }
        $data[] = [
            'game_platform' => $game['game_type'],
            'game_id'       => $game['game_id'],
            'merchant_id'   => 10000,
            'title'         => $game['title'],
            'title_en'      => $game['title_en'],
            'rtp'           => $game['rtp'],
            'rtp_type'      => $game['rtp_type'],
            'free_game_status'   => $game['free_game_status'],
            'bet_line_count'     => $game['bet_line_count'],
            'bet_max_level'      => $game['bet_max_level'],
            'max_multiple_count' => $game['max_multiple_count'],
            'deposit_list'       => $game['deposit_list'],
            'default_deposit'    => $game['default_deposit'],
            'default_deposit_level' => $game['default_deposit_level'],
            'status'             => $game['status'],
        ];
    }
}

GameModel::insertAll($data);