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

后台设备模块开发

@@ -73,6 +73,20 @@ class AdminLightController extends AdminBaseController @@ -73,6 +73,20 @@ class AdminLightController extends AdminBaseController
73 return $this->fetch(); 73 return $this->fetch();
74 } 74 }
75 75
  76 + public function index2(){
  77 + $id=$this->request->param('id');
  78 + $data = Db::name('light')
  79 + ->alias('l')
  80 + ->join('temple t','l.temple_id=t.id')
  81 + ->join('temple_area ta','l.area_id=ta.id')
  82 + ->where('l.temple_id',$id)
  83 + ->field('l.*,t.address,t.name as tname,ta.name as taname,ta.light')
  84 + ->order('l.create_time','desc')
  85 + ->paginate('10');
  86 + $this->assign('page',$data->render());
  87 + $this->assign('list',$data);
  88 + return $this->fetch();
  89 + }
76 /** 90 /**
77 * 添加设备 91 * 添加设备
78 * @adminMenu( 92 * @adminMenu(
  1 +<include file="public@header"/>
  2 +</head>
  3 +<body>
  4 +<div class="wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li class="active"><a href="javascript:;">设备列表</a></li>
  7 + <li><a href="{:url('AdminLight/add')}">添加设备</a></li>
  8 + </ul>
  9 + <form method="post" class="js-ajax-form margin-top-20">
  10 + <div class="table-actions">
  11 + <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
  12 + </div>
  13 + <table class="table table-hover table-bordered table-list">
  14 + <thead>
  15 + <tr>
  16 + <th width="50">ID</th>
  17 + <th>设备ID</th>
  18 + <th>设备位置</th>
  19 + <th>价格(元)</th>
  20 + <th>设备运行状态</th>
  21 + <th>地区</th>
  22 + <th>所属寺庙</th>
  23 + <th>所属区域</th>
  24 + <!--<th>该区域空位</th>-->
  25 + <th>操作</th>
  26 + </tr>
  27 + </thead>
  28 + <tbody>
  29 + <foreach name="list" item="vo">
  30 + <tr>
  31 + <td>{$vo.id}</td>
  32 + <td>{$vo.number}</td>
  33 + <td>{$vo.row}排{$vo.column}位</td>
  34 + <td>{$vo.price}</td>
  35 + <td>
  36 + <eq name="vo.status" value="0">未运行</eq>
  37 + <eq name="vo.status" value="1">服务中</eq>
  38 + <eq name="vo.status" value="2">关机</eq>
  39 + <eq name="vo.status" value="3">故障</eq>
  40 + <eq name="vo.status" value="4">欠费</eq>
  41 + <eq name="vo.status" value="5">待绑定</eq>
  42 + </td>
  43 + <td>{$vo.address}</td>
  44 + <td>{$vo.tname}</td>
  45 + <td>{$vo.taname}</td>
  46 + <td>
  47 + <a href="{:url('AdminLight/edit',array('id'=>$vo['id']))}">编辑</a>
  48 + <a class="js-ajax-delete" href="{:url('AdminLight/delete',array('id'=>$vo['id']))}">
  49 + {:lang('DELETE')}
  50 + </a>
  51 + </td>
  52 + </tr>
  53 + </foreach>
  54 + </tbody>
  55 + <tfoot>
  56 + <tr>
  57 + <th width="50">ID</th>
  58 + <th>设备ID</th>
  59 + <th>设备位置</th>
  60 + <th>价格(元)</th>
  61 + <th>设备运行状态</th>
  62 + <th>地区</th>
  63 + <th>所属寺庙</th>
  64 + <th>所属区域</th>
  65 + <!--<th>该区域空位</th>-->
  66 + <th>操作</th>
  67 + </tr>
  68 + </tfoot>
  69 + </table>
  70 + <div class="table-actions">
  71 + <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
  72 + </div>
  73 + </form>
  74 + <ul class="pagination">{$page|default=''}</ul>
  75 +</div>
  76 +<script src="__STATIC__/js/admin.js"></script>
  77 +</body>
  78 +</html>
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 </eq> 68 </eq>
69 </td> 69 </td>
70 <td> 70 <td>
71 - <a href="{:url('AdminLight/index',array('id'=>$vo['id']))}">设备列表</a> 71 + <a href="javascript:parent.openIframeLayer('{:url('AdminLight/index2',array('id'=>$vo['id']))}');">设备列表</a>
72 <a href="{:url('AdminTemple/details',array('id'=>$vo['id']))}">详情</a> 72 <a href="{:url('AdminTemple/details',array('id'=>$vo['id']))}">详情</a>
73 <a href="{:url('AdminTemple/edit',array('id'=>$vo['id']))}">编辑</a> 73 <a href="{:url('AdminTemple/edit',array('id'=>$vo['id']))}">编辑</a>
74 <a class="js-ajax-delete" href="{:url('AdminTemple/delete',array('id'=>$vo['id']))}"> 74 <a class="js-ajax-delete" href="{:url('AdminTemple/delete',array('id'=>$vo['id']))}">