baja-lite 1.6.6 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sql.js +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baja-lite",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "some util for self",
5
5
  "homepage": "https://github.com/void-soul/baja-lite",
6
6
  "repository": {
package/sql.js CHANGED
@@ -2961,15 +2961,16 @@ export class SqlService {
2961
2961
  sortName: option.sortName ?? undefined,
2962
2962
  sortType: option.sortType ?? undefined
2963
2963
  });
2964
- let sql = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx: option.context, isCount: false, ...option.params });
2964
+ const ctx = Object.assign({}, option.context, globalThis[_Context]);
2965
+ let sql = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx, isCount: false, ...option.params });
2965
2966
  let sqlSum = '';
2966
2967
  let sqlCount = '';
2967
2968
  if (option.sum) {
2968
2969
  if (option.sumSelf) {
2969
- sqlCount = globalThis[_sqlCache].load(this._matchSqlid(`${option.sqlId}_sum`), { ctx: option.context, isCount: false, isSum: true, ...option.params });
2970
+ sqlCount = globalThis[_sqlCache].load(this._matchSqlid(`${option.sqlId}_sum`), { ctx, isCount: false, isSum: true, ...option.params });
2970
2971
  }
2971
2972
  else {
2972
- sqlSum = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx: option.context, isCount: false, isSum: true, ...option.params });
2973
+ sqlSum = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx, isCount: false, isSum: true, ...option.params });
2973
2974
  }
2974
2975
  }
2975
2976
  if (option.limitSelf !== true && option.pageSize > 0) {
@@ -2977,10 +2978,10 @@ export class SqlService {
2977
2978
  }
2978
2979
  if (option.pageSize > 0) {
2979
2980
  if (option.countSelf) {
2980
- sqlCount = globalThis[_sqlCache].load(this._matchSqlid(`${option.sqlId}_count`), { ctx: option.context, isCount: true, isSum: false, ...option.params });
2981
+ sqlCount = globalThis[_sqlCache].load(this._matchSqlid(`${option.sqlId}_count`), { ctx, isCount: true, isSum: false, ...option.params });
2981
2982
  }
2982
2983
  else {
2983
- sqlCount = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx: option.context, isCount: true, isSum: false, ...option.params });
2984
+ sqlCount = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx, isCount: true, isSum: false, ...option.params });
2984
2985
  }
2985
2986
  }
2986
2987
  if (option.sync === SyncMode.Sync) {