Browse Source

fix(R15): Message.send 订单已取消禁聊

dev
cursor 1 day ago
parent
commit
b2c03494dd
2 changed files with 8 additions and 5 deletions
  1. +2
    -0
      REVIEW.md
  2. +6
    -5
      app/controller/Message.php

+ 2
- 0
REVIEW.md View File

@ -233,3 +233,5 @@ npm run build:mp-weixin

+ 6
- 5
app/controller/Message.php View File

@ -56,6 +56,12 @@ class Message extends BaseController
return json(['code' => -1, 'data' => null, 'msg' => '消息过长,最多500字']);
}
// 拒单禁聊:订单已取消(status=3)禁止发送
$order = \app\model\Order::where('card_no', $cardNo)->order('id', 'desc')->find();
if ($order && intval($order->status) === 3) {
return json(['code' => -1, 'data' => null, 'msg' => '订单已取消,会话已结束']);
}
// 存储原始文本,Vue 模板 {{ }} 自动转义防 XSS
$msg = MessageModel::create([
'card_no' => $cardNo,
@ -67,8 +73,3 @@ class Message extends BaseController
return json(['code' => 0, 'data' => ['id' => $msg->id], 'msg' => 'ok']);
}
}

Loading…
Cancel
Save