fixed
This commit is contained in:
@@ -37,7 +37,7 @@ class BaseLogic
|
||||
if(empty($this->base_url)){
|
||||
throw new \Exception('请先设置ai客服配置');
|
||||
}
|
||||
$tokenArr = (new TokenLogic())->getToken();
|
||||
$tokenArr = (new TokenWechatLogic())->getToken();
|
||||
$postdata['appId'] = $tokenArr['appId'];
|
||||
$domain = $this->base_url;
|
||||
$timeout = 4;
|
||||
|
||||
8
superadmin/application/api/logic/GechatroomLogic.php → superadmin/application/api/logic/GechatroomWechatLogic.php
Executable file → Normal file
8
superadmin/application/api/logic/GechatroomLogic.php → superadmin/application/api/logic/GechatroomWechatLogic.php
Executable file → Normal file
@@ -11,7 +11,7 @@ namespace app\api\logic;
|
||||
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
|
||||
class GechatroomLogic extends BaseLogic
|
||||
class GechatroomWechatLogic extends BaseWechatLogic
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ class GechatroomLogic extends BaseLogic
|
||||
//$this->getChatroomMemberList();die;
|
||||
//$base_url = config('gewechat.base_url');
|
||||
//去查询群名称
|
||||
$logic = new GewechatFriendsLogic();
|
||||
$logic = new GewechatFriendsWechatLogic();
|
||||
$logic->setBaseUrlByAiCustmerConfig($ai_config_id);
|
||||
$wxids_arr = $logic->getFriendWxIdsList();
|
||||
$chatrooms = $wxids_arr['data']['chatrooms'];
|
||||
@@ -49,7 +49,7 @@ class GechatroomLogic extends BaseLogic
|
||||
|
||||
function getChatroomMemberList(){
|
||||
//去查询群名称
|
||||
$wxids_arr = (new GewechatFriendsLogic())->getFriendWxIdsList();
|
||||
$wxids_arr = (new GewechatFriendsWechatLogic())->getFriendWxIdsList();
|
||||
$chatrooms = $wxids_arr['data']['chatrooms'];
|
||||
dump($chatrooms);
|
||||
$url = '/group/getChatroomMemberDetail';
|
||||
@@ -75,7 +75,7 @@ class GechatroomLogic extends BaseLogic
|
||||
*/
|
||||
function getChatroomMemberDetail(){
|
||||
//去查询群名称
|
||||
$wxids_arr = (new GewechatFriendsLogic())->getFriendWxIdsList();
|
||||
$wxids_arr = (new GewechatFriendsWechatLogic())->getFriendWxIdsList();
|
||||
$chatrooms = $wxids_arr['data']['chatrooms'];
|
||||
dump($chatrooms);
|
||||
$url = '/group/getChatroomMemberDetail';
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
* description:
|
||||
* author:wh
|
||||
* email:
|
||||
* createTime:{2025/3/22} {14:11}
|
||||
*/
|
||||
|
||||
namespace app\api\logic;
|
||||
|
||||
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
|
||||
class GewechatFriendsWechatLogic extends BaseWechatLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* desc:查询微信好友/群/关注的公众号列表[不带昵称]
|
||||
* author:wh
|
||||
* @return array 返回的是好友的微信id,需要昵称就要调好友查询接口
|
||||
*
|
||||
* array(3) {
|
||||
["ret"] => int(200)
|
||||
["msg"] => string(12) "操作成功"
|
||||
["data"] => array(3) {
|
||||
["friends"] => array(11) {
|
||||
[0] => string(8) "fmessage"
|
||||
[1] => string(9) "medianote"
|
||||
[2] => string(11) "floatbottle"
|
||||
[3] => string(8) "qmessage"
|
||||
[4] => string(6) "qqmail"
|
||||
[5] => string(6) "weixin"
|
||||
[6] => string(19) "wxid_lqhlkt5nq80n12"
|
||||
[7] => string(19) "wxid_xazzsfs57xt321"
|
||||
[8] => string(8) "antas001"
|
||||
[9] => string(19) "wxid_28a3dob3olc522"
|
||||
[10] => string(19) "wxid_b7m1xkqu2s7l22"
|
||||
}
|
||||
["chatrooms"] => array(3) {
|
||||
[0] => string(19) "7037032174@chatroom"
|
||||
[1] => string(20) "52468523601@chatroom"
|
||||
[2] => string(20) "52984126208@chatroom"
|
||||
}
|
||||
["ghs"] => array(1) {
|
||||
[0] => string(15) "gh_3dfda90e39d6"
|
||||
}
|
||||
}
|
||||
}
|
||||
*
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
function getFriendWxIdsList()
|
||||
{
|
||||
$url = '/contacts/fetchContactsList';
|
||||
$post_data = [];
|
||||
Tools::log_to_write_txt(['查询微信好友列表[不带昵称],入参:$post_data'=>$post_data]);
|
||||
$res = $this->curl_post_json($url, $post_data);
|
||||
Tools::log_to_write_txt(['查询微信好友列表[不带昵称],出参:$res'=>$res]);
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* desc:查询微信好友列表[带昵称]
|
||||
* author:wh
|
||||
* @return array 返回的是好友的微信id,需要昵称就要调好友查询接口
|
||||
* @throws \Exception
|
||||
*/
|
||||
function getFriendDetailList()
|
||||
{
|
||||
$wxids_arr = $this->getFriendWxIdsList();
|
||||
$wxids = $wxids_arr['data']['friends'];
|
||||
$url = '/contacts/getDetailInfo';
|
||||
$post_data = ['wxids'=>$wxids];
|
||||
Tools::log_to_write_txt(['查询微信好友列表[带昵称],入参:$post_data'=>$post_data]);
|
||||
$res = $this->curl_post_json($url, $post_data);
|
||||
Tools::log_to_write_txt(['查询微信好友列表[带昵称],出参:$res'=>$res]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace app\api\logic;
|
||||
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
|
||||
class PersonalLogic extends BaseLogic
|
||||
class PersonalWechatLogic extends BaseWechatLogic
|
||||
{
|
||||
function getProfile()
|
||||
{
|
||||
2
superadmin/application/api/logic/TokenLogic.php → superadmin/application/api/logic/TokenWechatLogic.php
Executable file → Normal file
2
superadmin/application/api/logic/TokenLogic.php → superadmin/application/api/logic/TokenWechatLogic.php
Executable file → Normal file
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
namespace app\api\logic;
|
||||
|
||||
class TokenLogic extends BaseLogic
|
||||
class TokenWechatLogic extends BaseWechatLogic
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
Reference in New Issue
Block a user