fix: 修复 desc 保留关键字导致的 SQL 语法错误
desc 是 PostgreSQL 保留关键字,需要加双引号转义
This commit is contained in:
@@ -249,7 +249,7 @@ pub async fn delete_weather_data(
|
||||
pub async fn get_user_by_id(pool: &PgPool, user_id: i32) -> Result<User, String> {
|
||||
let query = r#"
|
||||
SELECT
|
||||
id, name, openid, phone, type, desc, is_paid, is_admin, paid_expires_at
|
||||
id, name, openid, phone, type, "desc", is_paid, is_admin, paid_expires_at
|
||||
FROM users
|
||||
WHERE id = $1
|
||||
"#;
|
||||
|
||||
Reference in New Issue
Block a user