SxBasement.php 1.8 KB
<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use app\school\model\project_appointment\Building as BuildingModel;
use app\school\model\project_appointment\AppointmentRule as AppointmentRuleModel;
use app\school\model\project_appointment\Room as RoomModel;
use app\school\model\project_appointment\Floor as FloorModel;

class SxBasement extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = 'default';

    public function _initialize()
    {
        parent::_initialize(); // TODO: Change the autogenerated stub
        $roomTypeList = RoomModel::$room_type;
        $buildList = (new BuildingModel)->where("school_id",$this->school_id)->select();
        $roomList = (new RoomModel)->getCollegeRoom(["school_id"=>$this->school_id]);
        $enterRules = (new AppointmentRuleModel)->where(['school_id'=>$this->school_id])->find();
        if($enterRules) {
            $enterRules['data_url'] = json_decode($enterRules['data_url'],true);
        }
        $stationList = ['1' => '工位一','2' => '工位二','3' => '工位三','4' => '工位四','5' => '工位五','6' => '工位六','7' => '工位七','8' => '工位八'];
        $this->assign('roomTypeList',$roomTypeList);
        $this->assign('stationList',$stationList);
        $this->assign('enterRules',$enterRules);
        $this->assign('buildList',$buildList);
        $this->assign('roomList',$roomList);
    }

    public function index()
    {
        $this->assign('index','index');
        return $this->view->fetch();
    }

    public function downFiles($file_url)
    {
        $file_url = $this->request->param('file_url');
        $file_name = $this->request->param('file_name');
        downloadFile($file_url,$file_name);
    }

}