Files
fast_response/admin/application/api/controller/Feedback.php
2025-03-28 17:58:18 +08:00

68 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* description
* authorwh
* email
* createTime{2025/3/28} {17:01}
*/
namespace app\api\controller;
use think\Db;
use wanghua\general_utility_tools_php\Mmodel;
use wanghua\general_utility_tools_php\tool\Tools;
class Feedback extends BaseHttpApi
{
/**
* desc用户反馈
*
* 参数:
* content 反馈内容
* rel_wx 客户微信id
* rel_group 客户所在微信群id
*
* 接口:
* /api/Feedback/setUserFeedback
*
* authorwh
*/
function setUserFeedback(){
return Mmodel::catchJson(function (){
$content = input('content');
$rel_wx = input('rel_wx');//客户微信id
$wx_groupid = input('rel_group');//客户所在微信群id
if(empty($content)){
return Tools::set_fail('反馈内容不能为空');
}
if(empty($rel_wx)){
return Tools::set_fail('微信id不能为空');
}
if(empty($wx_groupid)){
return Tools::set_fail('群id不能为空');
}
//查询是否有回访记录
$ret = Db::table('fa_firmcustomerfollowuprecord')
->where('wx_groupid',$wx_groupid)
->where('rel_wx',$rel_wx)
->find();
if(empty($ret)){
return Tools::set_fail('该客户无回访记录');
}
Db::table('fa_firmcustomerfeedback')
->data([
'firmcustomer_id'=>$ret['firmcustomer_id'],
'rel_wx'=>$ret['rel_wx'],
'rel_group'=>$ret['rel_group'],
'msg'=>$content,
'firmcustomerfollowuprecord_id'=>$ret['id'],
])
->insert();
return Tools::set_ok();
});
}
}