Area.php
1.2 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
50
<?php
namespace app\inspection\controller;
use app\common\controller\Frontend;
class Area extends Frontend
{
protected $noNeedLogin = [];
protected $noNeedRight = '*';
protected $layout = '';
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\inspection\Area;
}
public function list()
{
$list = $this->model
->field('id,area_name')
->where('pid',1)
->paginate(10,'',['query'=>$this->request->param()]);
$this->view->assign('list',$list);
return $this->view->fetch();
}
public function areasite()
{
$condtion = [];
$area_id = $this->request->param('area_id');
if($area_id){
$condtion['area_id'] = ['=',$area_id];
}
$navlist= $list = $this->model
->field('id,area_name')
->where('pid',1)
->select();
$list = \app\admin\model\inspection\Areasite
::where($condtion)
->paginate(10,'',['query'=>$this->request->param()]);
$this->view->assign([
'list'=>$list,
'navlist'=>$navlist
]);
return $this->view->fetch();
}
}