master
wangxinglong 2022-08-08 14:36:31 +08:00
parent 1ede4f685b
commit 53baeecb35
3 changed files with 22 additions and 2 deletions

View File

@ -771,4 +771,23 @@ class Order extends Base
return $this->json(5001,"创建压缩文件失败"); return $this->json(5001,"创建压缩文件失败");
} }
public function del()
{
$id = input("id/d",0);
$order = OrderModel::findById($id);
if(empty($order)){
return $this->json(4001,"订单不存在");
}
Db::startTrans();
try {
OrderSku::where("order_coding",$order["coding"])->delete();
$order->delete();
Db::commit();
return $this->json();
}catch (Exception $e){
Db::rollback();
return $this->json(5001,"删除订单失败");
}
}
} }

View File

@ -154,7 +154,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
// {field: 'express_code', title: '快递公司代号', minWidth: 150, hide: true}, // {field: 'express_code', title: '快递公司代号', minWidth: 150, hide: true},
// {field: 'express_name', title: '快递公司名称', minWidth: 150, hide: true}, // {field: 'express_name', title: '快递公司名称', minWidth: 150, hide: true},
// {field: 'accepted_at', title: '确认收货时间', width: 160, hide: true}, // {field: 'accepted_at', title: '确认收货时间', width: 160, hide: true},
{ fixed: 'right', title: '操作', minWidth:220,templet: '#row-operate'} { fixed: 'right', title: '操作', minWidth:250,templet: '#row-operate'}
]], ]],
done: function () { done: function () {
Tools.setInsTb(insTb); Tools.setInsTb(insTb);

View File

@ -108,7 +108,8 @@
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/mall/order/info.html?id={{d.id}}" <a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/mall/order/info.html?id={{d.id}}"
data-title="订单详情" lay-event="info">详情</a> data-title="订单详情" lay-event="info">详情</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" data-href="/manager/mall/order/del.html?id={{d.id}}"
data-title="删除详情" lay-event="del">删除</a>
{{# if (d.status == 'paid' || d.status == 'shipped') { {{# if (d.status == 'paid' || d.status == 'shipped') {
let sendTitle = d.status == 'paid' ? '发货' : '重发'; let sendTitle = d.status == 'paid' ? '发货' : '重发';
}} }}