diff --git a/Application/Admin/Controller/TestOrderController.class.php b/Application/Admin/Controller/TestOrderController.class.php index 7feb70082..6ba7a699a 100644 --- a/Application/Admin/Controller/TestOrderController.class.php +++ b/Application/Admin/Controller/TestOrderController.class.php @@ -98,4 +98,27 @@ class TestOrderController extends ThinkController } } + + public function del() { + + $id = I('id'); + + if (!$id) { + $this->ajaxReturn(['status'=>0,'msg'=>'id失效']); + } + + $is_del = M('test_order','tab_')->where(['id'=>$id])->delete(); + + if ($is_del) { + + $this->ajaxReturn(['status'=>1,'msg'=>'删除成功']); + + } else { + + $this->ajaxReturn(['status'=>0,'msg'=>'删除失败']); + + } + + } + } \ No newline at end of file diff --git a/Application/Admin/View/TestOrder/addOrder.html b/Application/Admin/View/TestOrder/addOrder.html index 1938a363f..0f523d22e 100644 --- a/Application/Admin/View/TestOrder/addOrder.html +++ b/Application/Admin/View/TestOrder/addOrder.html @@ -247,18 +247,18 @@ layer.msg("支付订单号不能为空"); return; } - if (!$('#cp_order_no').val()) { - layer.msg("cp订单号不能为空"); - return; - } + // if (!$('#cp_order_no').val()) { + // layer.msg("cp订单号不能为空"); + // return; + // } if (!$('#user_account').val()) { layer.msg("测试账号不能为空"); return; } - if (!$('#game_name').val()) { - layer.msg("游戏不能为空"); - return; - } + // if (!$('#game_name').val()) { + // layer.msg("游戏不能为空"); + // return; + // } if (!$('#order_amount').val()) { layer.msg("订单金额不能为空"); return; diff --git a/Application/Admin/View/TestOrder/lists.html b/Application/Admin/View/TestOrder/lists.html index c22845ba8..db4673c94 100644 --- a/Application/Admin/View/TestOrder/lists.html +++ b/Application/Admin/View/TestOrder/lists.html @@ -132,6 +132,8 @@ 充值方式 录入时间 + + 操作 @@ -160,6 +162,7 @@ {$data.pay_amount} {$data.pay_way|get_pay_way} {$data.add_time|date='Y-m-d H:i:s',###} + 删除 @@ -174,6 +177,7 @@ {$sum_pay_amount['sum_order_amount']} ------ ------ + ------ @@ -217,6 +221,38 @@ console.log(href) }); + $(".del").click(function () { + var del = $(this).data(); + layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', { + btn: ['确认','取消'], + title:false + }, function(){ + var url = "/admin.php?s=/TestOrder/del/id/"+del.id; + + layer.load(2); + $.ajax({ + url: url, + type: "get", + dataType: "json", + success: function (data) { + if(data.status == 1){ + layer.closeAll('loading'); + layer.msg("删除成功"); + setTimeout(function(){ + window.location.reload(); + },350); + }else{ + alert("删除失败") + } + } + }) + + }, function(){ + + }); + + }); + $('#time-start').datetimepicker({ format: 'yyyy-mm-dd', language: "zh-CN",