Skip to content

Commit

Permalink
Merge pull request #169 from maxincai/master
Browse files Browse the repository at this point in the history
[Bug修复](1.1.4): V1.1.4版本发布
  • Loading branch information
maxincai authored Sep 28, 2021
2 parents d329dde + beba4aa commit d1ced4b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion api-server/app/core/install/src/Command/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class VersionCommand extends HyperfCommand
*
* @var string
*/
private const VERSION = '1.1.3';
private const VERSION = '1.1.4';

public function __construct()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function handle()
$params = $this->request->all();
$this->config = config('framework.wechat_open_platform');

## 使用授权码获取授权信息
// 使用授权码获取授权信息
$res = $this->queryAuth($params);
## 获取授权方的帐号基本信息
// 获取授权方的帐号基本信息
if ($res['id'] > 0) {
$this->authorizerInfo($res);
}
Expand Down Expand Up @@ -95,7 +95,7 @@ protected function officialAccountBindOpenPlatform(array $authorizationInfo)
*/
private function queryAuth($params): array
{
## EasyWeChat
// EasyWeChat
$this->openPlatform = Factory::openPlatform($this->config);
$this->openPlatform = rebind_app($this->openPlatform, $this->request);
$result = $this->openPlatform->handleAuthorize($params['auth_code']);
Expand All @@ -112,7 +112,7 @@ private function queryAuth($params): array
'corp_id' => (int) $params['corp_id'],
];
$authorizerAppid = $res['authorizer_appid'];
## 数据操作
// 数据操作
Db::beginTransaction();
try {
$info = $this->officialAccountService->getOfficialAccountByAppIdAuthorizerAppidCorpId($this->config['app_id'], $res['authorizer_appid'], (int) $params['corp_id'], ['id']);
Expand Down Expand Up @@ -146,23 +146,23 @@ private function authorizerInfo(array $authorizer): void
}
$result = $this->openPlatform->getAuthorizer($authorizer['authorizer_appid']);
if (! empty($result['authorizer_info'])) {
$res = $result['authorizer_info'];
$data = [
'nickname' => $res['nick_name'],
'head_img' => $res['head_img'],
'avatar' => File::uploadUrlImage($res['head_img'], 'contact/avatar/' . strval(microtime(true) * 10000) . '_' . uniqid() . '.jpg'),
'service_type_info' => $res['service_type_info']['id'],
'verify_type_info' => $res['verify_type_info']['id'],
'user_name' => $res['user_name'],
'principal_name ' => $res['principal_name'],
'alias' => isset($res['alias']) ? $res['alias'] : '',
'business_info' => json_encode($res['business_info'], JSON_THROW_ON_ERROR),
'qrcode_url' => $res['qrcode_url'],
'local_qrcode_url' => File::uploadUrlImage($res['qrcode_url'], 'contact/avatar/' . strval(microtime(true) * 10000) . '_' . uniqid() . '.jpg'),
];
## 数据操作
// 数据操作
Db::beginTransaction();
try {
$res = $result['authorizer_info'];
$data = [
'nickname' => isset($res['nick_name']) ? $res['nick_name'] : '',
'head_img' => isset($res['head_img']) ? $res['head_img'] : '',
'avatar' => isset($res['head_img']) ? $res['head_img'] : '',
'service_type_info' => isset($res['service_type_info']['id']) ? $res['service_type_info']['id'] : 0,
'verify_type_info' => isset($res['verify_type_info']['id']) ? $res['verify_type_info']['id'] : 0,
'user_name' => isset($res['user_name']) ? $res['user_name'] : '',
'principal_name ' => isset($res['principal_name']) ? $res['principal_name'] : '',
'alias' => isset($res['alias']) ? $res['alias'] : '',
'business_info' => isset($res['business_info']) ? json_encode($res['business_info'], JSON_THROW_ON_ERROR) : null,
'qrcode_url' => isset($res['qrcode_url']) ? $res['qrcode_url'] : '',
'local_qrcode_url' => '',
];
$this->officialAccountService->updateOfficialAccountById($authorizer['id'], $data);
Db::commit();
} catch (\Throwable $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,28 @@ class StoreLogic

/**
* 海报.
* @Inject()
* @var RoomFissionPosterContract
*/
protected $roomFissionPosterService;

/**
* 欢迎语.
* @Inject()
* @var RoomFissionWelcomeContract
*/
protected $roomFissionWelcomeService;

/**
* 群聊.
* @Inject()
* @var RoomFissionRoomContract
*/
protected $roomFissionRoomService;

/**
* 邀请用户.
* @Inject()
* @var RoomFissionInviteContract
*/
protected $roomFissionInviteService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ private function groupMsgSendResult(array $corp): void
continue;
}
foreach (json_decode($wxTid['wxTid'], true, 512, JSON_THROW_ON_ERROR) as $tid) {
$res = $app->getGroupSendResult($tid['tid'], $tid['wxUserId']);
$res = $app->httpPostJson('cgi-bin/externalcontact/get_groupmsg_send_result', [
'msgid' => $tid['tid'],
'userId' => $tid['wxUserId'],
'limit' => 500,
'cursor' => '',
]);
$result = $res['data'];
if ($result['errcode'] !== 0 || empty($result['send_list'])) {
continue;
Expand Down Expand Up @@ -114,7 +119,11 @@ private function groupMsgTask(array $corp): void
if ($tid['status'] === 1) {
continue;
}
$res = $app->getGroupTask($tid['tid']);
$res = $app->httpPostJson('cgi-bin/externalcontact/get_groupmsg_task', [
'msgid' => $tid['tid'],
'limit' => 500,
'cursor' => '',
]);
$result = $res['data'];
if ($result['errcode'] !== 0 || empty($result['task_list'])) {
continue;
Expand Down

0 comments on commit d1ced4b

Please sign in to comment.