新增ai聊天更新

This commit is contained in:
meimei
2025-04-22 11:39:12 +08:00
parent 8f15282a0a
commit 3bc4b07eda
5 changed files with 130 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ namespace app\index\controller;
use app\api\logic\MessageWechatLogic;
use app\api\logic\PyappLofic;
use app\api\logic\TokenWechatLogic;
use app\api\logic\UpdateMessageWechatLogic;
use think\Controller;
use think\Db;
use wanghua\general_utility_tools_php\Mmodel;
@@ -156,7 +157,11 @@ class Tasktimer extends Controller
//设置AI客服回访模式
$py_logic = new PyappLofic();
$py_logic->setFollowupModel($cust['rel_group'],$return_record);
$py_logic->setFollowupModel($base_url,$cust['rel_group'],$return_record);
//设置AI客服更新信息
$updateMessage_logic = new UpdateMessageWechatLogic();
$updateMessage_logic->getUpdateWechatMessage($base_url,$return_record['visit_msg'],$cust['rel_group']);
return Tools::set_ok('发送成功');
}
@@ -222,6 +227,7 @@ class Tasktimer extends Controller
//@的好友,多个英文逗号分隔。群主或管理员@全部的人,则填写'notify@all'
'ats'=>$customer_record['rel_wx'],
];
$wxid = $customer_record['rel_group'];
$type = 1;
}else{
if(!empty($customer_record['rel_wx'])){
@@ -230,6 +236,7 @@ class Tasktimer extends Controller
'toWxid'=>$customer_record['rel_wx'],//是群则发送群消息,否则发个人私人消息
'content'=>$birthday_record['content'],
];
$wxid = $customer_record['rel_wx'];
$type = 2;
}else{
return Tools::set_fail('客户未绑定微信和群');
@@ -247,6 +254,10 @@ class Tasktimer extends Controller
}
Tools::log_to_write_txt([$msg.'微信群客户,结束:$res'=>$res]);
//设置AI客服更新信息
$updateMessage_logic = new UpdateMessageWechatLogic();
$updateMessage_logic->getUpdateWechatMessage($base_url,$birthday_record['content'],$wxid);
return Tools::set_ok('发送成功');
}
}