作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

后台设备模块开发

@@ -127,9 +127,11 @@ class AdminLightController extends AdminBaseController @@ -127,9 +127,11 @@ class AdminLightController extends AdminBaseController
127 } 127 }
128 128
129 //获取区域下所有位置 129 //获取区域下所有位置
130 - public function getLocation() 130 + public function getLocation($id)
131 { 131 {
132 - $id = $this->request->param('id'); 132 + if (empty($id)) {
  133 + $id = $this->request->param('id');
  134 + }
133 $data = Db::name('temple_area')->where('id', $id)->find(); 135 $data = Db::name('temple_area')->where('id', $id)->find();
134 $arr = []; 136 $arr = [];
135 for ($r = 1; $r <= $data['rows']; $r++) { 137 for ($r = 1; $r <= $data['rows']; $r++) {
@@ -207,7 +209,7 @@ class AdminLightController extends AdminBaseController @@ -207,7 +209,7 @@ class AdminLightController extends AdminBaseController
207 $this->assign('temple', $temple); 209 $this->assign('temple', $temple);
208 $area = Db::name('temple_area')->where('temple_id', $data['temple_id'])->select(); 210 $area = Db::name('temple_area')->where('temple_id', $data['temple_id'])->select();
209 $this->assign('area', $area); 211 $this->assign('area', $area);
210 - $location=$this->getLocation(['id'=>$data['area_id']]); 212 + $location=$this->getLocation($id=$data['area_id']);
211 print_r($location); 213 print_r($location);
212 $this->assign('location', $location); 214 $this->assign('location', $location);
213 $this->assign('list', $data); 215 $this->assign('list', $data);