68 lines
1.7 KiB
PHP
68 lines
1.7 KiB
PHP
<?php
|
||
/*
|
||
* description:
|
||
* author:wh
|
||
* email:
|
||
* createTime:{2025/3/28} {21:41}
|
||
*/
|
||
|
||
namespace app\api\logic;
|
||
|
||
|
||
use wanghua\general_utility_tools_php\http\Curl;
|
||
use wanghua\general_utility_tools_php\SundryConfig;
|
||
use wanghua\general_utility_tools_php\tool\Tools;
|
||
|
||
/**
|
||
* python项目逻辑
|
||
* Class PyappLofic
|
||
* @package app\api\logic
|
||
*/
|
||
class PyappLofic
|
||
{
|
||
|
||
/**
|
||
* desc:设置回访模式
|
||
* author:wh
|
||
* @throws \Exception
|
||
*/
|
||
function setFollowupModel($chatroom_id,$return_record){
|
||
|
||
$base_url = SundryConfig::val('py_app_base_url');
|
||
$url = $base_url.'/vip_groups/follow-up';
|
||
$post_data = [
|
||
'chatroom_id' => $chatroom_id,
|
||
'is_follow_up' => true,
|
||
'follow_up_content'=>$return_record['visit_msg'],
|
||
'followup_record_id'=>$return_record['id'].'',
|
||
];
|
||
$res = Curl::curl_post_json($url, $post_data);
|
||
if(empty($res['data'])){
|
||
return Tools::set_fail('设置回访模式失败',$res);
|
||
}
|
||
$res_data = json_decode($res['data'], true);
|
||
return $res_data;
|
||
}
|
||
|
||
/**
|
||
* desc:关闭回访模式
|
||
* author:wh
|
||
* @throws \Exception
|
||
*/
|
||
function closeFollowupModel($chatroom_id){
|
||
$base_url = SundryConfig::val('py_app_base_url');
|
||
$url = $base_url.'/vip_groups/follow-up';
|
||
|
||
$post_data = [
|
||
'chatroom_id' => $chatroom_id,
|
||
'followup_model' => false,
|
||
];
|
||
$res = Curl::curl_post($url, $post_data);
|
||
if(empty($res['data'])){
|
||
throw new \Exception('关闭回访模式失败');
|
||
}
|
||
$res_data = json_decode($res['data'], true);
|
||
return $res_data;
|
||
}
|
||
|
||
} |