代码提交
This commit is contained in:
@@ -205,7 +205,7 @@ class AutomaticAssign extends BaseController
|
||||
// 设置请求头
|
||||
$headerData = ['client:system'];
|
||||
$header = setHeader($headerData, $authorization, 'json');
|
||||
|
||||
|
||||
// 发送请求
|
||||
$url = $this->baseUrl . 'api/WechatFriend/allot?wechatFriendId='.$wechatFriendId.'¬ifyReceiver='.$notifyReceiver.'&comment='.$comment.'&toAccountId='.$toAccountId.'&optFrom='.$optFrom;
|
||||
$result = requestCurl($url, [], 'PUT', $header, 'json');
|
||||
@@ -231,4 +231,45 @@ class AutomaticAssign extends BaseController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function multiAllotFriendToAccount($data = []){
|
||||
// 获取授权token
|
||||
$authorization = $this->authorization;
|
||||
if (empty($authorization)) {
|
||||
return json_encode(['code'=>500,'msg'=>'缺少授权信息']);
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
// 参数验证
|
||||
if (empty($wechatFriendId)) {
|
||||
return errorJson('微信好友ID不能为空');
|
||||
}
|
||||
|
||||
if (empty($toAccountId)) {
|
||||
return errorJson('目标账号ID不能为空');
|
||||
}
|
||||
|
||||
|
||||
// 设置请求头
|
||||
$headerData = ['client:system'];
|
||||
$header = setHeader($headerData, $authorization, 'json');
|
||||
|
||||
// 发送请求
|
||||
$url = $this->baseUrl . 'api/WechatFriend/multiAllotFriendToAccount?wechatFriendIds='.$wechatFriendIds.'&toAccountId='.$toAccountId.'¬ifyReceiver='.$notifyReceiver;
|
||||
$result = requestCurl($url, [], 'PUT', $header, 'json');
|
||||
|
||||
if (empty($result)) {
|
||||
return json_encode(['code'=>200,'msg'=>'微信好友分配成功']);
|
||||
} else {
|
||||
return json_encode(['code'=>500,'msg'=> $result]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user