mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
修复小程序 unionid 获取
This commit is contained in:
parent
c65cacdea3
commit
41362b42c8
@ -117,7 +117,7 @@ class Wxapp extends Controller
|
||||
$result = Crypt::instance($this->config)->session($code);
|
||||
if (isset($result['openid']) && isset($result['session_key'])) {
|
||||
$this->app->cache->set($code, $result, 60);
|
||||
return [$result['openid'], $cache['unionid'] ?? '', $result['session_key']];
|
||||
return [$result['openid'], $result['unionid'] ?? '', $result['session_key']];
|
||||
} elseif (isset($result['errmsg'])) {
|
||||
$this->error($result['errmsg']);
|
||||
} else {
|
||||
|
@ -120,7 +120,7 @@ class UserAdminService extends Service
|
||||
public function getUserUniMap(string $field, string $openid, string $unionid = ''): array
|
||||
{
|
||||
if (!empty($unionid)) {
|
||||
[$map1, $map2] = [[['unionid', 'eq', $unionid]], [[$field, 'eq', $openid]]];
|
||||
[$map1, $map2] = [[['unionid', '=', $unionid]], [[$field, '=', $openid]]];
|
||||
if ($uid = $this->app->db->name('DataUser')->whereOr([$map1, $map2])->value('id')) {
|
||||
return ['id' => $uid];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user