index.html
<a class="btn btn-danger btn-change btn-tuikuan btn-disabled" href="javascript:;"><i class="fa fa-tuikuan"></i> 订单退款</a>-->
order.js
// 为表格绑定事件Table.api.bindevent(table);//退款按钮$(document).on("click", ".btn-tuikuan", function () {//在table外不可以使用添加.btn-change的方法//只能自己调用Table.api.multi实现//如果操作全部则ids可以置为空Layer.confirm(__('确定要对此订单退款吗?'), {icon: 3,title: '提示'}, function (index) {var ids = Table.api.selectedids(table);Backend.api.ajax({url: "daren/Daren_order/tuikuan",data: {ids: ids.join(","),table: "daren_order"}}, function () {$(".btn-refresh").trigger("click");});Layer.close(index);});});
/*** 启用*/public function tuikuan($ids = '',$table = ""){$roomid = explode(',',$ids);if(empty($table)) $this->error("参数请求错误");if(count($roomid)>1) $this->error("请选择一条订单操作");if(strcasecmp($table,'user_yecz_order')==0){$order = Db::name($table)->where('id',$roomid[0])->find();if(empty($order)) $this->error("订单不存在");if(strcasecmp($order['order_status'],'1')==0) $this->error("订单未付款");if(strcasecmp($order[