68 lines
1.8 KiB
PHP
68 lines
1.8 KiB
PHP
<?php
|
||
/*
|
||
* description:
|
||
* author:wh
|
||
* 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
|
||
*
|
||
* author:wh
|
||
*/
|
||
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();
|
||
});
|
||
}
|
||
} |