ts-glitter 21.6.8 → 21.7.1

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.
@@ -246,7 +246,10 @@ export class Rebate {
246
246
  try {
247
247
  if (query.search || query.email_or_phone) {
248
248
  const users = (await db.query(getUsersSQL, [])).map((user: { userID: number }) => user.userID);
249
- rebateSearchSQL = `AND r.user_id in (${users.join(',')})`;
249
+ if(users.length > 0){
250
+ rebateSearchSQL = `AND r.user_id in (${users.join(',')})`;
251
+ }
252
+
250
253
  }
251
254
 
252
255
  const rebateCountSQL = `SELECT count(r.id) as c FROM \`${this.app}\`.t_rebate_point as r
@@ -2211,7 +2211,7 @@ class Shopping {
2211
2211
  else if (!update.orderData.user_info.shipment_number) {
2212
2212
  delete update.orderData.user_info.shipment_date;
2213
2213
  }
2214
- const updateProgress = update.orderData.progress;
2214
+ const updateProgress = update.orderData.progress || 'wait';
2215
2215
  if (updateProgress === 'wait' &&
2216
2216
  update.orderData.user_info.shipment_number &&
2217
2217
  update.orderData.user_info.shipment_number !== origin.orderData.user_info.shipment_number) {
@@ -3222,9 +3222,7 @@ class Shopping {
3222
3222
  insertObj.id = originalVariant.id;
3223
3223
  sourceMap[originalVariant.id] = originalVariant.id;
3224
3224
  }
3225
- const insertData = await database_js_1.default.query(`replace
3226
- INTO \`${this.app}\`.t_variants
3227
- SET ?
3225
+ const insertData = await database_js_1.default.query(`REPLACE INTO \`${this.app}\`.t_variants SET ?
3228
3226
  `, [insertObj]);
3229
3227
  return insertData;
3230
3228
  });
@@ -3250,9 +3248,8 @@ class Shopping {
3250
3248
  user_id: 'manager',
3251
3249
  value: exhibitionConfig,
3252
3250
  });
3253
- await database_js_1.default.query(`UPDATE \`${this.app}\`.t_manager_post
3254
- SET ?
3255
- WHERE id = ?`, [{ content: JSON.stringify(content) }, content.id]);
3251
+ await database_js_1.default.query(`UPDATE \`${this.app}\`.t_manager_post SET ? WHERE id = ?
3252
+ `, [{ content: JSON.stringify(content) }, content.id]);
3256
3253
  }
3257
3254
  catch (error) {
3258
3255
  console.error(error);