This commit is contained in:
parent
4c0f59399b
commit
ad3c6dcee2
|
@ -197,6 +197,18 @@ module.exports = function(Self) {
|
||||||
* Shortcut to VnMySQL.executeP()
|
* Shortcut to VnMySQL.executeP()
|
||||||
*/
|
*/
|
||||||
rawSql(query, params, options, cb) {
|
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);
|
return this.dataSource.connector.executeP(query, params, options, cb);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ module.exports = function(Self) {
|
||||||
const date = Date.vnNew();
|
const date = Date.vnNew();
|
||||||
date.setHours(0, 0, 0, 0);
|
date.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
const myOptions = {};
|
const myOptions = {userId};
|
||||||
let tx;
|
let tx;
|
||||||
|
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
|
|
Loading…
Reference in New Issue