wip #5595
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alexandre Riera 2023-05-03 14:34:36 +02:00
parent 4c0f59399b
commit ad3c6dcee2
2 changed files with 13 additions and 1 deletions

View File

@ -197,6 +197,18 @@ module.exports = function(Self) {
* Shortcut to VnMySQL.executeP()
*/
rawSql(query, params, options, cb) {
const userId = options.userId;
if (userId) {
params.unshift(userId);
return this.dataSource.connector.executeP(
`CALL account.myUser_loginWithName((SELECT name FROM account.user WHERE id = ?));
${query};
CALL account.myUser_logout();`,
params,
options,
cb
);
}
return this.dataSource.connector.executeP(query, params, options, cb);
},

View File

@ -29,7 +29,7 @@ module.exports = function(Self) {
const date = Date.vnNew();
date.setHours(0, 0, 0, 0);
const myOptions = {};
const myOptions = {userId};
let tx;
if (typeof options == 'object')