5 Commits

Author SHA1 Message Date
liufumingren
276a6ef37d fix(chat): 修复 PHP 7.4 升级引发的其余告警(implode 弃用、null 取下标)
全量检查 chat 相关代码(Chat.php / qiwe/Index.php / library/chat/Orders.php
/ library/qiwe / new_wms/Forward.php),补齐升级后才暴露的问题:

1. implode 参数反序(4 处,PHP 7.4 起 E_DEPRECATED,TP5 会抛成异常):
   Chat.php 群列表/指令/门店查询里  implode(\," and ")
   -> implode(" and ", \),输出 SQL 完全一致
2. carriage 查运费:getOrderInfoByPostnum 未命中返回 false,
   if(\["ID"]) 在 7.4 会抛 bool 取下标 -> 改为 if(\ && \["ID"])
3. kdroomMessageExplpde2 队列消费:json_decode 失败时 \ 为 null,
   补 is_array 判断跳过脏数据
4. qiwe/Index.php 5 处接口返回 json_decode 后直接用 \["code"]:
   补 \ && 前置判断(getRoomList/batchGetRoomDetails/
   batchGetUserinfo/sendImage/sendFile),避免空返回时抛 notice
5. chat/Orders.php createOrderToWms:订单回查为 null 时取 POSTNUM/ID/
   ERRORRECORDS 的兜底,改为 empty() 与 ??

以上均为 7.4 兼容性修复,业务行为保持不变。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:23:27 +08:00
liufumingren
c4aa873bea fix(chat): 修复消息事务中的 null 取下标(PHP 7.4 抛出 ErrorException)
企微入口 processMessages 在事务中捕获到 Trying to access array offset on
value of type null:消息"打包视频+单号"走 dabaoVideo -> getOrderInfoByPostnum
时,Express 表查不到该单号,find() 返回 null,随后直接取 ["TRADEORDER"]。
PHP 7.4 起该 notice 被抛成异常,导致整条消息事务回滚、无回复。

- getOrderInfoByPostnum:先取 TRADEORDER 到变量并用 ?? 兜底,4 处引用统一
- fastruku:仓库未取到时 ["operatorID"] 加 ?? 0
- createOrder:群未登记时 ['isOrder'] 用 ?? 0 兜底
- createPostnum:3 处 Wsdl::webservice 的仓库参数补 ?? 兜底
- grabnum(): 为空时改用 empty() 判断,避免 notice
- qiwe processMessages 事务失败日志补充出错文件与行号,便于定位

以上均为等价语义,仅消除 PHP 7.4 下的 notice/异常。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:19:18 +08:00
liufumingren
395cfeb14a feat: new_wms_notify reply 支持多用户 @(user_id 数组/分隔字符串) 2026-08-29 06:36:22 +08:00
liufumingren
e177a4771f feat: IM通道在线检测(qiwe新增getProfile/checkOnline,new_wms_notify reply离线返回503) 2026-08-18 00:55:01 +08:00
liufumingren
e8605149c0 初始化 2026-08-06 17:04:35 +08:00