<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Routing\Redirector;
use App\Models\History;
use Illuminate\Support\Facades\App;

class TopController extends Controller
{
    /**
     * @return string
     */
    public function index(Request $request)
    {
        $user = Auth::user();
        $data['history_list'] = History::getHistoryByCompany($user->company_id);
        //todo
        $param = $request->type;
        if($param == 1) {
            return view('admin.pages.top-sales');
        }
        return view('admin.pages.top', $data);
    }
}
