<commit_before><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\MiningActivity;
use App\Payment;
use Illuminate\Support\Facades\DB;

class ReportsController extends Controller
{
    /**
     * Default report view. Show a table of dates with amount mined per day.
     */
    public function main()
    {

        $daily_mining = MiningActivity::select(DB::raw('SUM(quantity) AS quantity, DAY(updated_at) AS order_day, MONTH(updated_at) AS order_month, YEAR(updated_at) AS order_year'))
            ->groupBy('order_day', 'order_month', 'order_year')
            ->orderBy('order_year', 'desc')
            ->orderBy('order_month', 'desc')
            ->orderBy('order_day', 'desc')
            ->get();

        $daily_income = Payment::select(DB::raw('SUM(amount_received) AS amount, DAY(updated_at) AS order_day, MONTH(updated_at) AS order_month, YEAR(updated_at) AS order_year'))
            ->groupBy('order_day', 'order_month', 'order_year')
            ->orderBy('order_year', 'desc')
            ->orderBy('order_month', 'desc')
            ->orderBy('order_day', 'desc')
            ->get();

        return view('reports.main', [
            'daily_mining' => $daily_mining,
            'daily_income' => $daily_income,
        ]);<commit_msg>Use creation date of mining activity, not update date.<commit_after><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\MiningActivity;
use App\Payment;
use Illuminate\Support\Facades\DB;

class ReportsController extends Controller
{
    /**
     * Default report view. Show a table of dates with amount mined per day.
     */
    public function main()
    {

        $daily_mining = MiningActivity::select(DB::raw('SUM(quantity) AS quantity, DAY(created_at) AS order_day, MONTH(created_at) AS order_month, YEAR(created_at) AS order_year'))
            ->groupBy('order_day', 'order_month', 'order_year')
            ->orderBy('order_year', 'desc')
            ->orderBy('order_month', 'desc')
            ->orderBy('order_day', 'desc')
            ->get();

        $daily_income = Payment::select(DB::raw('SUM(amount_received) AS amount, DAY(updated_at) AS order_day, MONTH(updated_at) AS order_month, YEAR(updated_at) AS order_year'))
            ->groupBy('order_day', 'order_month', 'order_year')
            ->orderBy('order_year', 'desc')
            ->orderBy('order_month', 'desc')
            ->orderBy('order_day', 'desc')
            ->get();

        return view('reports.main', [
            'daily_mining' => $daily_mining,
            'daily_income' => $daily_income,
        ]);
{'fraction_non_alphanumeric': 0.1437908496732026, 'fraction_numerical': 0.0, 'mean_word_length': 2.9907975460122698, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4614917', 'n_tokens_mistral': 818, 'n_tokens_neox': 781, 'n_words': 174}