//前台代码 执行enter方法的为设置按钮,将状态设置为正在使用,并且接下来的操作都为操作该公众号。
<table class="layui-table">
<colgroup>
<col width="150">
<col width="200">
<col>
</colgroup>
<thead>
<tr>
<th>昵称</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<volist name="data" id="row">
<tr>
<td>{$row.name}</td>
<td>
<if condition="$row.is_use == 1">正在使用<else/>未使用</if>
</td>
<td><a href="{:U('usemp')}?id={$row.id}" class="layui-btn layui-btn-xs">进入公众号</a>
<a href="{:U('enter')}?id={$row.id}" class="layui-btn layui-btn-xs">接入微信服务器</a></td>
</tr>
</volist>
</tbody>
</table>
后台控制器部分代码
public function enter($id){
$id = I('id');
if (empty($id)) {
$this->error('非法访问','index',3);
}else{
$mp = M('mp')->find($id);
$mp['url'] = "http://".$_SERVER['HTTP_HOST'].U('Mp/index/index',array('id'=>$mp['id']));
$this->assign('mp',$mp);
$this->display();
}
}