<tr id="{$v.uid}">
{switch name="$v.is_on" }
{case value="已启用" }<a href="javascript:void(0);" class="cli">已启用</a>{/case}
{case value="已停用"}<a href="javascript:void(0);" class="cli">已停用</a>{/case}
{default /}默认情况
{/switch}
$(".cli").on("click",function(){var lt=$(this).text();
var qh='';
if(lt=='已启用'){qh='已停用';$(this).html("已停用");
}else{qh='已启用';$(this).html("已启用");}
var rid=$(this).parents("tr").attr("id");
$.get("{:url('')}?id="+rid+"&is_on="+qh,
function(data){if(data==1){console.log(data);
}else{alert("");return false;}});} );
$rid=Request::instance()->param("id");
$data['is_on']=Request::instance()->param("is_on");
if(Db::table('user')->where('uid',$rid)->update($data))