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

后台设备模块开发

... ... @@ -73,6 +73,20 @@ class AdminLightController extends AdminBaseController
return $this->fetch();
}
public function index2(){
$id=$this->request->param('id');
$data = Db::name('light')
->alias('l')
->join('temple t','l.temple_id=t.id')
->join('temple_area ta','l.area_id=ta.id')
->where('l.temple_id',$id)
->field('l.*,t.address,t.name as tname,ta.name as taname,ta.light')
->order('l.create_time','desc')
->paginate('10');
$this->assign('page',$data->render());
$this->assign('list',$data);
return $this->fetch();
}
/**
* 添加设备
* @adminMenu(
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">设备列表</a></li>
<li><a href="{:url('AdminLight/add')}">添加设备</a></li>
</ul>
<form method="post" class="js-ajax-form margin-top-20">
<div class="table-actions">
<!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="50">ID</th>
<th>设备ID</th>
<th>设备位置</th>
<th>价格(元)</th>
<th>设备运行状态</th>
<th>地区</th>
<th>所属寺庙</th>
<th>所属区域</th>
<!--<th>该区域空位</th>-->
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="list" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.number}</td>
<td>{$vo.row}排{$vo.column}位</td>
<td>{$vo.price}</td>
<td>
<eq name="vo.status" value="0">未运行</eq>
<eq name="vo.status" value="1">服务中</eq>
<eq name="vo.status" value="2">关机</eq>
<eq name="vo.status" value="3">故障</eq>
<eq name="vo.status" value="4">欠费</eq>
<eq name="vo.status" value="5">待绑定</eq>
</td>
<td>{$vo.address}</td>
<td>{$vo.tname}</td>
<td>{$vo.taname}</td>
<td>
<a href="{:url('AdminLight/edit',array('id'=>$vo['id']))}">编辑</a>
<a class="js-ajax-delete" href="{:url('AdminLight/delete',array('id'=>$vo['id']))}">
{:lang('DELETE')}
</a>
</td>
</tr>
</foreach>
</tbody>
<tfoot>
<tr>
<th width="50">ID</th>
<th>设备ID</th>
<th>设备位置</th>
<th>价格(元)</th>
<th>设备运行状态</th>
<th>地区</th>
<th>所属寺庙</th>
<th>所属区域</th>
<!--<th>该区域空位</th>-->
<th>操作</th>
</tr>
</tfoot>
</table>
<div class="table-actions">
<!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
</div>
</form>
<ul class="pagination">{$page|default=''}</ul>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -68,7 +68,7 @@
</eq>
</td>
<td>
<a href="{:url('AdminLight/index',array('id'=>$vo['id']))}">设备列表</a>
<a href="javascript:parent.openIframeLayer('{:url('AdminLight/index2',array('id'=>$vo['id']))}');">设备列表</a>
<a href="{:url('AdminTemple/details',array('id'=>$vo['id']))}">详情</a>
<a href="{:url('AdminTemple/edit',array('id'=>$vo['id']))}">编辑</a>
<a class="js-ajax-delete" href="{:url('AdminTemple/delete',array('id'=>$vo['id']))}">
... ...