diff --git a/app/shop/controller/order/Order.php b/app/shop/controller/order/Order.php index 2e20e735..c4705e5f 100755 --- a/app/shop/controller/order/Order.php +++ b/app/shop/controller/order/Order.php @@ -371,4 +371,18 @@ class Order extends ShopBase 'express' => $express ]); } + + // 结账 + public function end_bills() + { + if ($this->request->isAjax()) { + $id = $this->request->post('id'); + $result = OrderLogic::updateEndBills($id); + if ($result) { + return JsonServer::success('操作成功'); + } + + return JsonServer::error('操作失败'); + } + } } \ No newline at end of file diff --git a/app/shop/logic/order/OrderLogic.php b/app/shop/logic/order/OrderLogic.php index 61fc970f..8f90ba38 100755 --- a/app/shop/logic/order/OrderLogic.php +++ b/app/shop/logic/order/OrderLogic.php @@ -1269,4 +1269,12 @@ class OrderLogic extends Logic return $express_data; } + + public static function updateEndBills($id) + { + return Order::where('id', $id)->update([ + 'end_bills' => 1, + 'update_time' => time() + ]); + } } \ No newline at end of file diff --git a/app/shop/view/order/order/lists.html b/app/shop/view/order/order/lists.html index 4b22c370..02e598c5 100755 --- a/app/shop/view/order/order/lists.html +++ b/app/shop/view/order/order/lists.html @@ -239,6 +239,9 @@ 允许售后 {{# } }} + + 结账 @@ -319,6 +322,14 @@ {{ d.total_num }}件 + + @@ -452,6 +463,7 @@ , {field: 'total_num', title: '商品数量', align: 'center', templet: '#goods_num', width: 70} , {field: 'total_amount', title: '订单金额', align: 'center', templet: '#amount', width: 150} , {field: 'delivery', title: '收货信息', align: 'center', templet: '#delivery', width: 200} + , {field: 'end_bills', title: '结账状态', align: 'center', width: 100, templet: '#end-bills'} , {field: 'pay_status_text', title: '支付状态', align: 'center', width: 100} , {field: 'order_status_text', title: '订单状态', align: 'center', width: 100} , {fixed: 'right', title: '操作', width: 300, align: 'center', toolbar: '#order-operation'} @@ -722,6 +734,29 @@ }); } + if (obj.event === 'end-bills') { + layer.confirm('是否结账' + obj.data.order_sn + '', { + btn: ['确认', '取消'] + }, function () { + like.ajax({ + url: '{:url("order.order/end_bills")}' + , data: {id} + , type: 'post' + , success: function (res) { + if (res.code == 1) { + layui.layer.msg(res.msg, { + offset: '15px' + , icon: 1 + , time: 1000 + }, function () { + updateTabNumber(); + table.reload('order-lists'); + }); + } + }, + }); + }); + } }); /**