PHP Warning: Module 'soap' already loaded in Unknown on line 0 Warning: Module 'soap' already loaded in Unknown on line 0 Psy Shell v0.9.12 (PHP 7.3.33 — cli) by Justin Hileman New version is available (current: v0.9.12, latest: v0.12.24) >>> echo "===SALES-BY-MONTH==="; ===SALES-BY-MONTH===⏎ >>> $sm = DB::select("SELECT DATE_FORMAT(created_at, "%Y-%m") as month, COUNT(*) as cnt, SUM(order_amount) as total_order, SUM(comission) as total_commission FROM sales GROUP BY month ORDER BY month"); PHP Parse error: Syntax error, unexpected '%' on line 1 >>> foreach($sm as $r) { echo json_encode($r)." ... "; } PHP Notice: Undefined variable: sm in Psy Shell code on line 1 >>> echo "===SALES-BY-STORE-TOP-50==="; ===SALES-BY-STORE-TOP-50===⏎ >>> $ss = DB::select("SELECT store_id, COUNT(*) as cnt, SUM(order_amount) as total_order, SUM(comission) as total_commission FROM sales GROUP BY store_id ORDER BY total_commission DESC LIMIT 50"); => [ {#1022 +"store_id": 62, +"cnt": 2284697, +"total_order": "40849504.07", +"total_commission": "2132828.24", }, {#1023 +"store_id": 8, +"cnt": 18147, +"total_order": "2831068.05", +"total_commission": "100163.86", }, {#1026 +"store_id": 95, +"cnt": 74051, +"total_order": "1327463.75", +"total_commission": "71331.51", }, {#1032 +"store_id": 187, +"cnt": 857, +"total_order": "414061.36", +"total_commission": "61851.93", }, {#1036 +"store_id": 191, +"cnt": 526, +"total_order": "402644.38", +"total_commission": "42411.20", }, {#1033 +"store_id": 365, +"cnt": 699, +"total_order": "798667.46", +"total_commission": "42289.91", }, {#1035 +"store_id": 9, +"cnt": 287, +"total_order": "221582.12", +"total_commission": "30650.09", }, {#1034 +"store_id": 177, +"cnt": 10288, +"total_order": "585112.12", +"total_commission": "25846.44", }, {#1037 +"store_id": null, +"cnt": 2900, +"total_order": "241181.64", +"total_commission": "25422.73", }, {#1038 +"store_id": 19, +"cnt": 305, +"total_order": "1264.27", +"total_commission": "14101.56", }, {#1039 +"store_id": 868, +"cnt": 190, +"total_order": "384534.61", +"total_commission": "10753.25", }, {#1040 +"store_id": 869, +"cnt": 66, +"total_order": "152972.35", +"total_commission": "7611.51", }, {#1041 +"store_id": 26, +"cnt": 3122, +"total_order": "90225.32", +"total_commission": "5523.82", }, {#1042 +"store_id": 295, +"cnt": 333, +"total_order": "17170.84", +"total_commission": "2734.20", }, {#1043 +"store_id": 356, +"cnt": 1324, +"total_order": "18878.33", +"total_commission": "1443.91", }, {#1044 +"store_id": 183, +"cnt": 239, +"total_order": "2357.60", +"total_commission": "922.69", }, {#1045 +"store_id": 325, +"cnt": 21, +"total_order": "107656.38", +"total_commission": "861.30", }, {#1046 +"store_id": 349, +"cnt": 92, +"total_order": "8499.83", +"total_commission": "849.94", }, {#1047 +"store_id": 10, +"cnt": 88, +"total_order": "6096.52", +"total_commission": "782.41", }, {#1048 +"store_id": 47, +"cnt": 28, +"total_order": "11066.75", +"total_commission": "651.08", }, {#1049 +"store_id": 16, +"cnt": 4, +"total_order": "6710.29", +"total_commission": "575.16", }, {#1050 +"store_id": 402, +"cnt": 109, +"total_order": "7516.84", +"total_commission": "567.17", }, {#1051 +"store_id": 343, +"cnt": 185, +"total_order": "2568.82", +"total_commission": "503.81", }, {#1052 +"store_id": 165, +"cnt": 1, +"total_order": "282.55", +"total_commission": "424.88", }, {#1053 +"store_id": 518, +"cnt": 1, +"total_order": "5579.02", +"total_commission": "278.95", }, {#1054 +"store_id": 432, +"cnt": 38, +"total_order": "13870.04", +"total_commission": "277.42", }, {#1055 +"store_id": 200, +"cnt": 10, +"total_order": "4849.37", +"total_commission": "235.02", }, {#1056 +"store_id": 212, +"cnt": 8, +"total_order": "3858.67", +"total_commission": "209.33", }, {#1057 +"store_id": 188, +"cnt": 19, +"total_order": "1705.73", +"total_commission": "199.20", }, {#1058 +"store_id": 143, +"cnt": 3, +"total_order": "419.04", +"total_commission": "172.74", }, {#1059 +"store_id": 378, +"cnt": 6, +"total_order": "1292.94", +"total_commission": "169.14", }, {#1060 +"store_id": 37, +"cnt": 37, +"total_order": "3587.12", +"total_commission": "167.66", }, {#1061 +"store_id": 222, +"cnt": 1, +"total_order": "2000.00", +"total_commission": "150.00", }, {#1062 +"store_id": 474, +"cnt": 1, +"total_order": "975.00", +"total_commission": "97.50", }, {#1063 +"store_id": 58, +"cnt": 7, +"total_order": "7765.36", +"total_commission": "97.07", }, {#1064 +"store_id": 11, +"cnt": 9, +"total_order": "566.57", +"total_commission": "78.99", }, {#1065 +"store_id": 281, +"cnt": 8, +"total_order": "724.30", +"total_commission": "72.52", }, {#1066 +"store_id": 302, +"cnt": 6, +"total_order": "580.66", +"total_commission": "61.01", }, {#1067 +"store_id": 88, +"cnt": 1, +"total_order": "465.52", +"total_commission": "55.86", }, {#1068 +"store_id": 24, +"cnt": 9, +"total_order": "1132.31", +"total_commission": "54.23", }, {#1069 +"store_id": 120, +"cnt": 3, +"total_order": "456.08", +"total_commission": "48.63", }, {#1070 +"store_id": 52, +"cnt": 2, +"total_order": "178.34", +"total_commission": "46.28", }, {#1071 +"store_id": 364, +"cnt": 11, +"total_order": "371.89", +"total_commission": "43.09", }, {#1072 +"store_id": 277, +"cnt": 2, +"total_order": "14.48", +"total_commission": "42.00", }, {#1073 +"store_id": 374, +"cnt": 2, +"total_order": "435.32", +"total_commission": "41.93", }, {#1074 +"store_id": 46, +"cnt": 2, +"total_order": "1014.39", +"total_commission": "39.28", }, {#1075 +"store_id": 296, +"cnt": 3, +"total_order": "486.38", +"total_commission": "35.61", }, {#1076 +"store_id": 14, +"cnt": 4, +"total_order": "221.30", +"total_commission": "34.15", }, {#1077 +"store_id": 186, +"cnt": 5, +"total_order": "336.75", +"total_commission": "32.45", }, {#1078 +"store_id": 286, +"cnt": 4, +"total_order": "1980.45", +"total_commission": "30.76", }, ] >>> foreach($ss as $r) { echo json_encode($r)." ... "; } {"store_id":62,"cnt":2284697,"total_order":"40849504.07","total_commission":"2132828.24"} {"store_id":8,"cnt":18147,"total_order":"2831068.05","total_commission":"100163.86"} {"store_id":95,"cnt":74051,"total_order":"1327463.75","total_commission":"71331.51"} {"store_id":187,"cnt":857,"total_order":"414061.36","total_commission":"61851.93"} {"store_id":191,"cnt":526,"total_order":"402644.38","total_commission":"42411.20"} {"store_id":365,"cnt":699,"total_order":"798667.46","total_commission":"42289.91"} {"store_id":9,"cnt":287,"total_order":"221582.12","total_commission":"30650.09"} {"store_id":177,"cnt":10288,"total_order":"585112.12","total_commission":"25846.44"} {"store_id":null,"cnt":2900,"total_order":"241181.64","total_commission":"25422.73"} {"store_id":19,"cnt":305,"total_order":"1264.27","total_commission":"14101.56"} {"store_id":868,"cnt":190,"total_order":"384534.61","total_commission":"10753.25"} {"store_id":869,"cnt":66,"total_order":"152972.35","total_commission":"7611.51"} {"store_id":26,"cnt":3122,"total_order":"90225.32","total_commission":"5523.82"} {"store_id":295,"cnt":333,"total_order":"17170.84","total_commission":"2734.20"} {"store_id":356,"cnt":1324,"total_order":"18878.33","total_commission":"1443.91"} {"store_id":183,"cnt":239,"total_order":"2357.60","total_commission":"922.69"} {"store_id":325,"cnt":21,"total_order":"107656.38","total_commission":"861.30"} {"store_id":349,"cnt":92,"total_order":"8499.83","total_commission":"849.94"} {"store_id":10,"cnt":88,"total_order":"6096.52","total_commission":"782.41"} {"store_id":47,"cnt":28,"total_order":"11066.75","total_commission":"651.08"} {"store_id":16,"cnt":4,"total_order":"6710.29","total_commission":"575.16"} {"store_id":402,"cnt":109,"total_order":"7516.84","total_commission":"567.17"} {"store_id":343,"cnt":185,"total_order":"2568.82","total_commission":"503.81"} {"store_id":165,"cnt":1,"total_order":"282.55","total_commission":"424.88"} {"store_id":518,"cnt":1,"total_order":"5579.02","total_commission":"278.95"} {"store_id":432,"cnt":38,"total_order":"13870.04","total_commission":"277.42"} {"store_id":200,"cnt":10,"total_order":"4849.37","total_commission":"235.02"} {"store_id":212,"cnt":8,"total_order":"3858.67","total_commission":"209.33"} {"store_id":188,"cnt":19,"total_order":"1705.73","total_commission":"199.20"} {"store_id":143,"cnt":3,"total_order":"419.04","total_commission":"172.74"} {"store_id":378,"cnt":6,"total_order":"1292.94","total_commission":"169.14"} {"store_id":37,"cnt":37,"total_order":"3587.12","total_commission":"167.66"} {"store_id":222,"cnt":1,"total_order":"2000.00","total_commission":"150.00"} {"store_id":474,"cnt":1,"total_order":"975.00","total_commission":"97.50"} {"store_id":58,"cnt":7,"total_order":"7765.36","total_commission":"97.07"} {"store_id":11,"cnt":9,"total_order":"566.57","total_commission":"78.99"} {"store_id":281,"cnt":8,"total_order":"724.30","total_commission":"72.52"} {"store_id":302,"cnt":6,"total_order":"580.66","total_commission":"61.01"} {"store_id":88,"cnt":1,"total_order":"465.52","total_commission":"55.86"} {"store_id":24,"cnt":9,"total_order":"1132.31","total_commission":"54.23"} {"store_id":120,"cnt":3,"total_order":"456.08","total_commission":"48.63"} {"store_id":52,"cnt":2,"total_order":"178.34","total_commission":"46.28"} {"store_id":364,"cnt":11,"total_order":"371.89","total_commission":"43.09"} {"store_id":277,"cnt":2,"total_order":"14.48","total_commission":"42.00"} {"store_id":374,"cnt":2,"total_order":"435.32","total_commission":"41.93"} {"store_id":46,"cnt":2,"total_order":"1014.39","total_commission":"39.28"} {"store_id":296,"cnt":3,"total_order":"486.38","total_commission":"35.61"} {"store_id":14,"cnt":4,"total_order":"221.30","total_commission":"34.15"} {"store_id":186,"cnt":5,"total_order":"336.75","total_commission":"32.45"} {"store_id":286,"cnt":4,"total_order":"1980.45","total_commission":"30.76"} >>> echo "===BALANCE-TRANSACTIONS-BY-TYPE==="; ===BALANCE-TRANSACTIONS-BY-TYPE===⏎ >>> $bt = DB::select("SELECT transaction_type, COUNT(*) as cnt, SUM(amount) as total FROM balance_transactions GROUP BY transaction_type"); => [ {#1020 +"transaction_type": "confirmed_bonus", +"cnt": 63363, +"total": "1249588.57", }, {#1016 +"transaction_type": "pending_bonus", +"cnt": 738721, +"total": "7834666.57", }, {#1017 +"transaction_type": "confirmed_cashback", +"cnt": 3688113, +"total": "2926278.68", }, {#1021 +"transaction_type": "completed_payout", +"cnt": 8137, +"total": "-1679631.43", }, {#1125 +"transaction_type": "pending_cashback", +"cnt": 1494091, +"total": "3753485.30", }, {#1121 +"transaction_type": "declined_cashback", +"cnt": 938162, +"total": "0.00", }, {#1124 +"transaction_type": "failed_payout", +"cnt": 313, +"total": "0.00", }, {#1122 +"transaction_type": "declined_payout", +"cnt": 2965, +"total": "0.00", }, {#1123 +"transaction_type": "created_payout", +"cnt": 9589, +"total": "-2804304.25", }, {#1120 +"transaction_type": "declined_bonus", +"cnt": 6160, +"total": "0.00", }, {#1119 +"transaction_type": "processing_payout", +"cnt": 5013, +"total": "-1290299.25", }, {#1118 +"transaction_type": "revert", +"cnt": 4047163, +"total": "-7648581.60", }, ] >>> foreach($bt as $r) { echo json_encode($r)." ... "; } {"transaction_type":"confirmed_bonus","cnt":63363,"total":"1249588.57"} {"transaction_type":"pending_bonus","cnt":738721,"total":"7834666.57"} {"transaction_type":"confirmed_cashback","cnt":3688113,"total":"2926278.68"} {"transaction_type":"completed_payout","cnt":8137,"total":"-1679631.43"} {"transaction_type":"pending_cashback","cnt":1494091,"total":"3753485.30"} {"transaction_type":"declined_cashback","cnt":938162,"total":"0.00"} {"transaction_type":"failed_payout","cnt":313,"total":"0.00"} {"transaction_type":"declined_payout","cnt":2965,"total":"0.00"} {"transaction_type":"created_payout","cnt":9589,"total":"-2804304.25"} {"transaction_type":"declined_bonus","cnt":6160,"total":"0.00"} {"transaction_type":"processing_payout","cnt":5013,"total":"-1290299.25"} {"transaction_type":"revert","cnt":4047163,"total":"-7648581.60"} >>> echo "===PAYOUTS-BY-STATUS==="; ===PAYOUTS-BY-STATUS===⏎ >>> $ps = DB::select("SELECT status, COUNT(*) as cnt, SUM(amount) as total_usd, SUM(local_amount) as total_local FROM user_payouts GROUP BY status"); => [ {#1014 +"status": "created", +"cnt": 11, +"total_usd": "1401.60", +"total_local": "1706.79", }, {#1027 +"status": "completed", +"cnt": 6352, +"total_usd": "1283530.10", +"total_local": "47934054.64", }, {#1029 +"status": "declined", +"cnt": 2754, +"total_usd": "954071.50", +"total_local": "8542269.50", }, {#1031 +"status": "failed", +"cnt": 215, +"total_usd": "25451.88", +"total_local": "745718.78", }, ] >>> foreach($ps as $r) { echo json_encode($r)." ... "; } {"status":"created","cnt":11,"total_usd":"1401.60","total_local":"1706.79"} {"status":"completed","cnt":6352,"total_usd":"1283530.10","total_local":"47934054.64"} {"status":"declined","cnt":2754,"total_usd":"954071.50","total_local":"8542269.50"} {"status":"failed","cnt":215,"total_usd":"25451.88","total_local":"745718.78"} >>> echo "===PAYOUTS-BY-METHOD==="; ===PAYOUTS-BY-METHOD===⏎ >>> $pm = DB::select("SELECT method_code, COUNT(*) as cnt, SUM(amount) as total_usd, SUM(local_amount) as total_local FROM user_payouts GROUP BY method_code"); => [ {#1129 +"method_code": "aman", +"cnt": 92, +"total_usd": "2075.45", +"total_local": "32592.48", }, {#1130 +"method_code": "bank-transfer", +"cnt": 66, +"total_usd": "14517.57", +"total_local": "14517.57", }, {#1128 +"method_code": "bank-transfer-eg", +"cnt": 2394, +"total_usd": "1376726.79", +"total_local": "47699357.24", }, {#1126 +"method_code": "cashu", +"cnt": 23, +"total_usd": "2971.81", +"total_local": "2971.81", }, {#1109 +"method_code": "e-wallet", +"cnt": 6618, +"total_usd": "780692.14", +"total_local": "9386869.29", }, {#1117 +"method_code": "paypal", +"cnt": 139, +"total_usd": "87471.32", +"total_local": "87441.32", }, ] >>> foreach($pm as $r) { echo json_encode($r)." ... "; } {"method_code":"aman","cnt":92,"total_usd":"2075.45","total_local":"32592.48"} {"method_code":"bank-transfer","cnt":66,"total_usd":"14517.57","total_local":"14517.57"} {"method_code":"bank-transfer-eg","cnt":2394,"total_usd":"1376726.79","total_local":"47699357.24"} {"method_code":"cashu","cnt":23,"total_usd":"2971.81","total_local":"2971.81"} {"method_code":"e-wallet","cnt":6618,"total_usd":"780692.14","total_local":"9386869.29"} {"method_code":"paypal","cnt":139,"total_usd":"87471.32","total_local":"87441.32"} >>> echo "===PAYOUTS-BY-MONTH==="; ===PAYOUTS-BY-MONTH===⏎ >>> $pm2 = DB::select("SELECT DATE_FORMAT(created_at, "%Y-%m") as month, COUNT(*) as cnt, SUM(amount) as total_usd FROM user_payouts GROUP BY month ORDER BY month"); PHP Parse error: Syntax error, unexpected '%' on line 1 >>> foreach($pm2 as $r) { echo json_encode($r)." ... "; } PHP Notice: Undefined variable: pm2 in Psy Shell code on line 1 >>> echo "===TOP-50-USERS-BY-TOTAL-PAYOUTS==="; ===TOP-50-USERS-BY-TOTAL-PAYOUTS===⏎ >>> $tu = DB::select("SELECT user_id, COUNT(*) as payout_count, SUM(amount) as total_paid FROM user_payouts WHERE status="completed" GROUP BY user_id ORDER BY total_paid DESC LIMIT 50"); PHP Parse error: Syntax error, unexpected T_STRING, expecting ')' on line 1 >>> foreach($tu as $r) { echo json_encode($r)." ... "; } PHP Notice: Undefined variable: tu in Psy Shell code on line 1 >>> echo "===DONE==="; ===DONE===⏎ >>> exit; Exit: Goodbye