ts-glitter 20.9.1 → 20.9.3

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.
package/lowcode/Entry.js CHANGED
@@ -144,7 +144,7 @@ export class Entry {
144
144
  }
145
145
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
146
146
  console.log(`Entry-time:`, window.renderClock.stop());
147
- glitter.share.editerVersion = 'V_20.9.1';
147
+ glitter.share.editerVersion = 'V_20.9.3';
148
148
  glitter.share.start = new Date();
149
149
  const vm = { appConfig: [] };
150
150
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  (window as any).renderClock = (window as any).renderClock ?? createClock();
148
148
  console.log(`Entry-time:`, (window as any).renderClock.stop());
149
- glitter.share.editerVersion = 'V_20.9.1';
149
+ glitter.share.editerVersion = 'V_20.9.3';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  (window as any).saasConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "20.9.1",
3
+ "version": "20.9.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2177,7 +2177,9 @@ class Shopping {
2177
2177
  update.orderData.lineItems = update.orderData.lineItems.filter((item) => item.count > 0);
2178
2178
  this.writeRecord(origin, update);
2179
2179
  const updateData = Object.entries(update).reduce((acc, [key, value]) => (Object.assign(Object.assign({}, acc), { [key]: typeof value === 'object' ? JSON.stringify(value) : value })), {});
2180
- await database_js_1.default.query(`UPDATE \`${this.app}\`.t_checkout SET ? WHERE id = ?;
2180
+ await database_js_1.default.query(`UPDATE \`${this.app}\`.t_checkout
2181
+ SET ?
2182
+ WHERE id = ?;
2181
2183
  `, [updateData, origin.id]);
2182
2184
  if (Array.isArray(update.orderData.tags)) {
2183
2185
  await this.setOrderCustomizeTagConifg(update.orderData.tags);
@@ -2205,26 +2207,39 @@ class Shopping {
2205
2207
  app_name: this.app,
2206
2208
  });
2207
2209
  const orderCountingSQL = await new user_js_1.User(this.app).getCheckoutCountingModeSQL();
2208
- const orderCount = await database_js_1.default.query(`SELECT * FROM \`${this.app}\`.t_checkout WHERE id = ? AND ${orderCountingSQL};
2210
+ const orderCount = await database_js_1.default.query(`SELECT *
2211
+ FROM \`${this.app}\`.t_checkout
2212
+ WHERE id = ?
2213
+ AND ${orderCountingSQL};
2209
2214
  `, [origin.id]);
2210
2215
  if (orderCount[0]) {
2211
2216
  await this.shareVoucherRebate(orderCount[0]);
2212
2217
  }
2213
2218
  const invoiceCountingConfig = await new user_js_1.User(this.app).getInvoiceCountingModeSQL();
2214
- const invoiceCount = await database_js_1.default.query(`SELECT * FROM \`${this.app}\`.t_checkout WHERE id = ? AND ${invoiceCountingConfig.sql_string};
2219
+ const invoiceCount = await database_js_1.default.query(`SELECT *
2220
+ FROM \`${this.app}\`.t_checkout
2221
+ WHERE id = ?
2222
+ AND ${invoiceCountingConfig.sql_string};
2215
2223
  `, [origin.id]);
2216
2224
  if (invoiceCount[0]) {
2217
2225
  const cart_token = invoiceCount[0].cart_token;
2218
- const json = {
2219
- tag: 'triggerInvoice',
2220
- content: JSON.stringify({ cart_token }),
2221
- trigger_time: tool_js_1.default.getCurrentDateTime({
2222
- inputDate: new Date().toISOString(),
2223
- addSeconds: invoiceCountingConfig.invoice_mode.afterDays * 86400,
2224
- }),
2225
- status: 0,
2226
- };
2227
- await database_js_1.default.query(`INSERT INTO \`${this.app}\`.t_triggers SET ?;`, [json]);
2226
+ const invoice_trigger_exists = await database_js_1.default.query(`select *
2227
+ from \`${this.app}\`.t_triggers
2228
+ where tag = 'triggerInvoice'
2229
+ and content ->>'$.cart_token'='${cart_token}'`, []);
2230
+ if (invoice_trigger_exists.length == 0) {
2231
+ const json = {
2232
+ tag: 'triggerInvoice',
2233
+ content: JSON.stringify({ cart_token }),
2234
+ trigger_time: tool_js_1.default.getCurrentDateTime({
2235
+ inputDate: new Date().toISOString(),
2236
+ addSeconds: invoiceCountingConfig.invoice_mode.afterDays * 86400,
2237
+ }),
2238
+ status: 0,
2239
+ };
2240
+ await database_js_1.default.query(`INSERT INTO \`${this.app}\`.t_triggers
2241
+ SET ?;`, [json]);
2242
+ }
2228
2243
  }
2229
2244
  return {
2230
2245
  result: 'success',
@@ -2805,7 +2820,7 @@ class Shopping {
2805
2820
  resolve({
2806
2821
  data: data,
2807
2822
  total: (await database_js_1.default.query(`SELECT count(1)
2808
- FROM (${sql}) as subqyery`, []))[0]['count(1)'],
2823
+ FROM (${sql}) as subqyery`, []))[0]['count(1)'],
2809
2824
  });
2810
2825
  }
2811
2826
  });
@@ -3151,7 +3166,8 @@ class Shopping {
3151
3166
  insertObj.id = originalVariant.id;
3152
3167
  sourceMap[originalVariant.id] = originalVariant.id;
3153
3168
  }
3154
- const insertData = await database_js_1.default.query(`replace INTO \`${this.app}\`.t_variants
3169
+ const insertData = await database_js_1.default.query(`replace
3170
+ INTO \`${this.app}\`.t_variants
3155
3171
  SET ?
3156
3172
  `, [insertObj]);
3157
3173
  return insertData;