From 12903ef3cd91d1a80dcaee2a163f28e1240c91c6 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 13 Feb 2020 16:01:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8E=E5=BD=95=E5=85=A5bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/TestOrderController.class.php | 12 +++++++++--- Application/Admin/View/TestOrder/addOrder.html | 2 +- Application/Admin/View/TestOrder/lists.html | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/TestOrderController.class.php b/Application/Admin/Controller/TestOrderController.class.php index c6b5e24d0..4ccae8f0f 100644 --- a/Application/Admin/Controller/TestOrderController.class.php +++ b/Application/Admin/Controller/TestOrderController.class.php @@ -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->display(); } @@ -56,12 +56,18 @@ class TestOrderController extends ThinkController $data['pay_time'] = strtotime($data['pay_time']); $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); if ($isSuccess) { - $this->ajaxReturn(['status'=>1]); + $this->ajaxReturn(['status'=>1,'msg'=>'订单录入成功']); } else { - $this->ajaxReturn(['status'=>0]); + $this->ajaxReturn(['status'=>0,'msg'=>'订单录入失败']); } } diff --git a/Application/Admin/View/TestOrder/addOrder.html b/Application/Admin/View/TestOrder/addOrder.html index 700acc551..d1c160c14 100644 --- a/Application/Admin/View/TestOrder/addOrder.html +++ b/Application/Admin/View/TestOrder/addOrder.html @@ -277,7 +277,7 @@ if (data.status == 1) { window.parent.reload(); } else { - layer.msg("测试订单录入失败"); + layer.msg(data.msg); } } diff --git a/Application/Admin/View/TestOrder/lists.html b/Application/Admin/View/TestOrder/lists.html index bb24da4b4..1a7db2da8 100644 --- a/Application/Admin/View/TestOrder/lists.html +++ b/Application/Admin/View/TestOrder/lists.html @@ -148,7 +148,7 @@ - 测试内网测试外网 + 测试内网测试外网 {$data.order_type|get_order_type} {$data.order_no} {$data.cp_order_no} @@ -206,6 +206,9 @@