<?php

use Illuminate\Support\Facades\Route;
use Modules\Statistic\Http\Controllers\ChargeTJController;
use Modules\Statistic\Http\Controllers\HomeStatisticsController;
use Modules\Statistic\Http\Controllers\UserStatisticsController;
use Modules\Statistic\Http\Controllers\VideoStatController;
use Modules\Statistic\Http\Controllers\ROITJController;

Route::prefix('statistic')->group(function(){
    //next
    // 用户统计
    Route::prefix('users')->group(function (){
        // 今天数据统计
        Route::any('today',[UserStatisticsController::class,'todayData']);
        // 历史充值统计
        Route::any('stats',[UserStatisticsController::class,'stats']);
        // 投手日充值列表
        Route::any('list',[UserStatisticsController::class,'list']);
        // 投手日充值列表汇总
        Route::any('list_statistics',[UserStatisticsController::class,'listStatistics']);
    });

    // 短剧统计
    Route::prefix('video')->group(function (){
        Route::get('list',[VideoStatController::class,'index'])->withoutMiddleware(config('catch.route.middlewares'));
        Route::get('stats',[VideoStatController::class,'stats'])->withoutMiddleware(config('catch.route.middlewares'));
    });
    // 充值统计
    Route::prefix('charge')->group(function() {
        Route::get('list', [ChargeTJController::class, 'list']);
        Route::get('todayCharge', [ChargeTJController::class, 'todayCharge']);
        Route::get('listTotalCharge', [ChargeTJController::class, 'listTotalCharge']);
        Route::get('currentMonthCharge', [ChargeTJController::class, 'currentMonthCharge']);
        Route::get('lastMonthCharge', [ChargeTJController::class, 'lastMonthCharge']);
        Route::get('totalCharge', [ChargeTJController::class, 'totalCharge']);
    });

    // 投入产出
    Route::prefix('roi')->group(function(){
        Route::get('list', [ROITJController::class, 'list']);
        Route::get('listTotal', [ROITJController::class, 'listTotal']);
        Route::post('updateCostmoney', [ROITJController::class, 'updateCostmoney'])->middleware('roleCheck:optimizer');
    });

    // 首页统计
    Route::any("home",[HomeStatisticsController::class,"statistics"]);

});
