<?php

namespace app\home\controller;

use app\common\model\PreviousModel;
use app\common\model\ReservedModel;
use app\home\HomeBaseController;

class Index extends HomeBaseController
{
    public function index()
    {
        $reserved = ReservedModel::where('status', ReservedModel::STATUS_SHOW)
            ->order(['priority' => 'desc', 'id' => 'desc'])
            ->select();
        $previous = PreviousModel::where('status', ReservedModel::STATUS_SHOW)
            ->order(['priority' => 'desc', 'id' => 'desc'])
            ->limit(3)
            ->select();
        return view('', [
            'reserved' => $reserved,
            'previous' => $previous,
        ]);
    }

}
