fix(chukebao): 修复触客宝 PC 页 500 — count 污染 query 与 nullable 字段

wechatFriend/chatroom/notice/followUp/todo 等接口在生产环境返回 500,改用 clone count 与字段兜底。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Manus AI
2026-05-25 05:38:09 +08:00
parent 3f7e1a4af6
commit ac47668016
6 changed files with 31 additions and 25 deletions

View File

@@ -39,7 +39,7 @@ class CustomerServiceController extends BaseController
foreach ($list as $k=>&$v){
$v['createTime'] = !empty($v['createTime']) ? date('Y-m-d H:i:s',$v['createTime']) : '';
$v['updateTime'] = !empty($v['updateTime']) ? date('Y-m-d H:i:s',$v['updateTime']) : '';
$v['labels'] = json_decode($v['labels'],true);
$v['labels'] = json_decode($v['labels'] ?? '', true) ?: [];
$momentsSetting = Db::name('kf_moments_settings')->where(['userId' => $userId,'companyId' => $companyId,'wechatId' =>$v['id']])->find();
$v['momentsMax'] = !empty($momentsSetting['max']) ? $momentsSetting['max'] : 5;
$v['momentsNum'] = !empty($momentsSetting['sendNum']) ? $momentsSetting['sendNum'] : 0;