|
|
@ -2364,8 +2364,10 @@ class BaseModelSqlv2 { |
|
|
|
if (response?.length) { |
|
|
|
if (response?.length) { |
|
|
|
id = response[0]; |
|
|
|
id = response[0]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const res = await this.execAndParse(query); |
|
|
|
const res = await this.execAndParse(query, null, { |
|
|
|
id = res?.id ?? res[0]?.insertId; |
|
|
|
raw: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
id = res?.id ?? res[0]?.insertId ?? res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ai) { |
|
|
|
if (ai) { |
|
|
@ -2727,11 +2729,8 @@ class BaseModelSqlv2 { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
rowId = await this.execAndParse(query, null, { |
|
|
|
rowId = await this.execAndParse(query, null, { |
|
|
|
raw: true, |
|
|
|
raw: true, |
|
|
|
first: true, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
if (this.isMySQL) { |
|
|
|
rowId = rowId.id ?? rowId[0]?.insertId ?? rowId; |
|
|
|
rowId = rowId?.insertId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ai) { |
|
|
|
if (ai) { |
|
|
|