fixed
This commit is contained in:
@@ -102,9 +102,12 @@ class Firmcustomerfollowuprecord extends Backend
|
||||
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
|
||||
$params[$this->dataLimitField] = $this->auth->id;
|
||||
}
|
||||
$params['name'] = Db::table('fa_firmcustomer')
|
||||
$cust = Db::table('fa_firmcustomer')
|
||||
->where('id',$params['firmcustomer_id'])
|
||||
->value('name');
|
||||
->find();
|
||||
$params['name'] = $cust['name'];
|
||||
$params['rel_wx'] = $cust['rel_wx'];
|
||||
$params['rel_group'] = $cust['rel_group'];
|
||||
$title_one = Db::table('fa_firmstoreprojectsone')
|
||||
->where('id',$params['firmstoreprojectsone_id'])
|
||||
->value('name');
|
||||
|
||||
68
admin/application/api/controller/Feedback.php
Normal file
68
admin/application/api/controller/Feedback.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?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();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user