代码提交

This commit is contained in:
wong
2025-07-11 17:38:44 +08:00
parent 80b52ce8c9
commit ce4beab201
2 changed files with 16 additions and 15 deletions

View File

@@ -189,7 +189,7 @@ class AutomaticAssign extends BaseController
$wechatFriendId = !empty($data['wechatFriendId']) ? $data['wechatFriendId'] : input('wechatFriendId', 0);
$toAccountId = !empty($data['toAccountId']) ? $data['toAccountId'] : input('toAccountId', 0);
$comment = !empty($data['comment']) ? $data['comment'] : input('comment', '');
$notifyReceiver = !empty($data['notifyReceiver']) ? $data['notifyReceiver'] : input('notifyReceiver', false);
$notifyReceiver = !empty($data['notifyReceiver']) ? $data['notifyReceiver'] : input('notifyReceiver', 'false');
$optFrom = !empty($data['optFrom']) ? $data['optFrom'] : input('optFrom', 4); // 默认操作来源为4
// 参数验证
@@ -234,7 +234,6 @@ class AutomaticAssign extends BaseController
}
public function multiAllotFriendToAccount($data = []){
// 获取授权token
$authorization = $this->authorization;
@@ -244,16 +243,15 @@ class AutomaticAssign extends BaseController
$wechatFriendIds = !empty($data['wechatFriendIds']) ? $data['wechatFriendIds'] : input('wechatFriendIds', []);
$toAccountId = !empty($data['toAccountId']) ? $data['toAccountId'] : input('toAccountId', 0);
$notifyReceiver = !empty($data['notifyReceiver']) ? $data['notifyReceiver'] : input('notifyReceiver', false);
$notifyReceiver = !empty($data['notifyReceiver']) ? $data['notifyReceiver'] : input('notifyReceiver', 'false');
// 参数验证
if (empty($wechatFriendIds)) {
return json_encode(['code'=>500,'msg'=>'微信好友ID不能为空']);
}
}
if (empty($toAccountId)) {
return json_encode(['code'=>500,'msg'=>'目标账号ID不能为空']);
}
if (empty($toAccountId)) {
return json_encode(['code'=>500,'msg'=>'目标账号ID不能为空']);
}
// 设置请求头
@@ -263,7 +261,6 @@ class AutomaticAssign extends BaseController
// 发送请求
$url = $this->baseUrl . 'api/WechatFriend/multiAllotFriendToAccount?wechatFriendIds='.$wechatFriendIds.'&toAccountId='.$toAccountId.'&notifyReceiver='.$notifyReceiver;
$result = requestCurl($url, [], 'PUT', $header, 'json');
if (empty($result)) {
return json_encode(['code'=>200,'msg'=>'微信好友分配成功']);
} else {