ImportGame.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require __DIR__ . '/../../vendor/autoload.php';
  3. use think\App;
  4. use \think\facade\Db;
  5. use app\model\GameModel;
  6. $app = App::getInstance();
  7. $app->initialize();
  8. $games = Db::connect('fortue_tiger')->table('tp_game_list')->where('id', '>', 0)->select()->toArray();
  9. if ($games)
  10. {
  11. foreach ($games as $game)
  12. {
  13. if (GameModel::checkGameIdExists(10000, $game['game_id'])) {
  14. continue;
  15. }
  16. $data[] = [
  17. 'game_platform' => $game['game_type'],
  18. 'game_id' => $game['game_id'],
  19. 'merchant_id' => 10000,
  20. 'title' => $game['title'],
  21. 'title_en' => $game['title_en'],
  22. 'rtp' => $game['rtp'],
  23. 'rtp_type' => $game['rtp_type'],
  24. 'free_game_status' => $game['free_game_status'],
  25. 'bet_line_count' => $game['bet_line_count'],
  26. 'bet_max_level' => $game['bet_max_level'],
  27. 'max_multiple_count' => $game['max_multiple_count'],
  28. 'deposit_list' => $game['deposit_list'],
  29. 'default_deposit' => $game['default_deposit'],
  30. 'default_deposit_level' => $game['default_deposit_level'],
  31. 'status' => $game['status'],
  32. ];
  33. }
  34. }
  35. GameModel::insertAll($data);