Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save agungyuliaji/0936e8e2dfa4443ceb4d4a188249a6fb to your computer and use it in GitHub Desktop.
Save agungyuliaji/0936e8e2dfa4443ceb4d4a188249a6fb to your computer and use it in GitHub Desktop.
igun
user_gain = {}
transactions.each do |t|
# bere persenan user ke 1 yg diatas
user_gain[user_gain_id_1] = [] if user_gain[user_gain_id_1].blank?
user_gain[user_gain_id_1] << nilai transaksi * 0.2%
# bere persenan user ke 2 yg diatas
# get: user_gain_id_2
user_gain[user_gain_id_2] = [] if user_gain[user_gain_id_2].blank?
user_gain[user_gain_id_2] << nilai transaksi
end
{
30: [10000, 20000, 40000],
50: []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment