This commit is contained in:
2024-07-17 16:07:48 +08:00
parent 5367e27e4e
commit 90f3103227

View File

@@ -45,6 +45,12 @@ class TychatLogic extends BaseLogic
$json = Tools::wss_json($action, 'chat_msg参数错误');
return Gateway::sendToClient($client_id, $json);
}
if(empty($data['items']['type'])){
$json = Tools::wss_json($action, 'type参数错误缺少角色类型:doc、user');
return Gateway::sendToClient($client_id, $json);
}
$type = $data['items']['type'];//角色类型
//if(empty($data['items']['username'])){
// $json = Tools::wss_json($action, 'username参数错误');
// return Gateway::sendToClient($client_id, $json);
@@ -119,6 +125,23 @@ class TychatLogic extends BaseLogic
return Tools::set_ok();
}
/**
* 查询聊天记录
*/
function getChatHistory(){
return Mmodel::catchJson(function (){
$username = input('username');
if(empty($username)){
return Tools::set_fail('参数错误');
}
$list = Db::table('fa_ty_chathistory')
->where('username',$username)
->order('id desc')
->select();
return Tools::set_ok('查询成功',$list);
});
}
/**
* desc健康洞察
*