Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ShinTrx < ActiveRecord::Base
- establish_connection(
- adapter: 'mysql2',
- host: 'localhost',
- encoding: 'utf8',
- username: 'root',
- password: '',
- database: 'shinkansen'
- )
- self.table_name = 'transactions'
- end
- ShinTrx.connection
- class ShinBook < ActiveRecord::Base
- establish_connection(
- adapter: 'mysql2',
- host: 'localhost',
- encoding: 'utf8',
- username: 'root',
- password: '',
- database: 'shinkansen'
- )
- self.table_name = 'books'
- end
- ShinBook.connection
- ids = ""
- ShinTrx.where(state: 5).find_each do |trx|
- begin
- ShinBook.where(transaction_id: trx.id).find_each do |book|
- begin
- res = VirtualProduct::Channel::Kai::GetBookInfo.info(book.book_code)
- if res.book_balance != 0
- ids = ids + trx.remote_transaction_id.to_s + "\n"
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement