fixed
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\api\logic\TychatLogic;
|
||||
use app\api\logic\UserOfflinePrizeLogic;
|
||||
use app\common\model\TabConf;
|
||||
use GatewayWorker\Lib\Gateway;
|
||||
@@ -170,4 +171,22 @@ class Users extends BaseHttpApi
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存听译聊天记录
|
||||
*
|
||||
* api/Users/saveChatHistory
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function saveChatHistory(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$obj = new TychatLogic();
|
||||
$chat_content = input('chat_content');
|
||||
if(empty($chat_content)){
|
||||
return Tools::set_fail('参数错误');
|
||||
}
|
||||
$res = $obj->saveChatHistory($chat_content);
|
||||
return Tools::set_ok('ok',$res);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -38,23 +38,23 @@ class TychatLogic extends BaseLogic
|
||||
]
|
||||
];
|
||||
*/
|
||||
function saveChatHistory($client_id,$res){
|
||||
$items = $res['items'];
|
||||
function saveChatHistory($chat_content){
|
||||
$data = [
|
||||
'username'=>$items['username'],
|
||||
'chat_msg'=>$items['content'],
|
||||
'chat_msg'=>$chat_content,
|
||||
];
|
||||
Db::table('fa_ty_chathistory')->insert($data);
|
||||
|
||||
//这里做健康小洞察
|
||||
//$this->getHealthInsight();
|
||||
|
||||
$json = BaseWssApi::json_wss('ok','保存成功');
|
||||
Gateway::sendToClient($client_id, $json);
|
||||
return Tools::set_ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:健康洞察
|
||||
*
|
||||
* api/HealthInsights/getHealthInsight
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function getHealthInsight(){
|
||||
|
||||
Reference in New Issue
Block a user