Commit f3e7b9fa8dd537a99a314234f2915c4c7b820074
1 parent
c32f0b57
fix: remove wx_unionid from sql due to schema mismatch
Showing
1 changed file
with
5 additions
and
5 deletions
| ... | ... | @@ -274,19 +274,19 @@ class AuthService |
| 274 | 274 | if ($user) { |
| 275 | 275 | // 更新 openid |
| 276 | 276 | if ($openid && $user['wx_openid'] !== $openid) { |
| 277 | - $stmt = $this->pdo->prepare("UPDATE users SET wx_openid = ?, wx_unionid = ? WHERE id = ?"); | |
| 278 | - $stmt->execute([$openid, $unionid, $user['id']]); | |
| 277 | + $stmt = $this->pdo->prepare("UPDATE users SET wx_openid = ? WHERE id = ?"); | |
| 278 | + $stmt->execute([$openid, $user['id']]); | |
| 279 | 279 | } |
| 280 | 280 | return $user; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | // 创建新用户 |
| 284 | 284 | $stmt = $this->pdo->prepare(" |
| 285 | - INSERT INTO users (phone, wx_openid, wx_unionid, nickname) | |
| 286 | - VALUES (?, ?, ?, ?) | |
| 285 | + INSERT INTO users (phone, wx_openid, nickname) | |
| 286 | + VALUES (?, ?, ?) | |
| 287 | 287 | "); |
| 288 | 288 | $nickname = '用户' . substr($phone, -4); |
| 289 | - $stmt->execute([$phone, $openid, $unionid, $nickname]); | |
| 289 | + $stmt->execute([$phone, $openid, $nickname]); | |
| 290 | 290 | |
| 291 | 291 | return [ |
| 292 | 292 | 'id' => $this->pdo->lastInsertId(), | ... | ... |
Please
register
or
login
to post a comment