SxBasement.php
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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);
}
}