Skip to content

Instantly share code, notes, and snippets.

@SmetDenis
Created May 17, 2018 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SmetDenis/27a8280163d7a17223957e45ad41d032 to your computer and use it in GitHub Desktop.
Save SmetDenis/27a8280163d7a17223957e45ad41d032 to your computer and use it in GitHub Desktop.
ho_conversions.php
<?php
// affiliate_id,offer_id,payout,revenue,datetime,is_adjustment
$data = [];
$months = [
'2017-10-17 23:55:55' => 11000,
'2017-11-17 23:55:55' => 12000,
'2017-12-17 23:55:55' => 10000,
'2018-01-17 23:55:55' => 10000,
'2018-02-17 23:55:55' => 20000,
'2018-03-17 23:55:55' => 25000,
'2018-04-17 23:55:55' => 27000,
'2018-05-17 23:55:55' => 20000,
];
foreach ($months as $month => $count) {
for ($i = 0; $i <= $count; $i++) {
$data[] = implode(',', [
'2',
'4',
'1.95',
'2.65',
$month,
'1'
]);
}
}
$csv = implode(PHP_EOL, $data);
file_put_contents(__DIR__ . './../build/conversions.csv', $csv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment