测试订单列表与录入bug修改

master
zhengyongxing 5 years ago
parent 42a0876ab2
commit 12903ef3cd

@ -38,7 +38,7 @@ class TestOrderController extends ThinkController
} }
$order_list = M('test_order', 'tab_')->where($map)->select(); $order_list = M('test_order', 'tab_')->where($map)->order('add_time desc')->select();
$this->assign('datas', $order_list); $this->assign('datas', $order_list);
$this->display(); $this->display();
} }
@ -56,12 +56,18 @@ class TestOrderController extends ThinkController
$data['pay_time'] = strtotime($data['pay_time']); $data['pay_time'] = strtotime($data['pay_time']);
$data['game_name'] = get_gamename($data['game_id']); $data['game_name'] = get_gamename($data['game_id']);
$is_exist = M('test_order','tab_')->where(['order_no'=>$data['order_no'],'cp_order_no'=>$data['cp_order_no']])->find();
if ($is_exist) {
$this->ajaxReturn(['status'=>0,'msg'=>'订单重复录入']);
}
$isSuccess = M('test_order','tab_')->add($data); $isSuccess = M('test_order','tab_')->add($data);
if ($isSuccess) { if ($isSuccess) {
$this->ajaxReturn(['status'=>1]); $this->ajaxReturn(['status'=>1,'msg'=>'订单录入成功']);
} else { } else {
$this->ajaxReturn(['status'=>0]); $this->ajaxReturn(['status'=>0,'msg'=>'订单录入失败']);
} }
} }

@ -277,7 +277,7 @@
if (data.status == 1) { if (data.status == 1) {
window.parent.reload(); window.parent.reload();
} else { } else {
layer.msg("测试订单录入失败"); layer.msg(data.msg);
} }
} }

@ -148,7 +148,7 @@
<notemtpy name = "datas"> <notemtpy name = "datas">
<volist name="datas" id="data"> <volist name="datas" id="data">
<tr> <tr>
<td ><if condition="data['order_type'] eq '1'">测试内网<else/>测试外网</if></td> <td ><if condition="$data.server_type eq 1">测试内网<else/>测试外网</if></td>
<td >{$data.order_type|get_order_type}</td> <td >{$data.order_type|get_order_type}</td>
<td >{$data.order_no}</td> <td >{$data.order_no}</td>
<td >{$data.cp_order_no}</td> <td >{$data.cp_order_no}</td>
@ -206,6 +206,9 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script> <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript"> <script type="text/javascript">
$(".select_gallery").select2(); $(".select_gallery").select2();
function reload() {
window.location.reload();
}
$(function(){ $(function(){
$('.page a').click(function () { $('.page a').click(function () {

Loading…
Cancel
Save