ts-glitter 14.7.4 → 14.7.5
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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/package.json +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/shopping.js +41 -32
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +150 -129
package/lowcode/Entry.js
CHANGED
|
@@ -80,7 +80,7 @@ export class Entry {
|
|
|
80
80
|
}
|
|
81
81
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
82
82
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
83
|
-
glitter.share.editerVersion = 'V_14.7.
|
|
83
|
+
glitter.share.editerVersion = 'V_14.7.5';
|
|
84
84
|
glitter.share.start = new Date();
|
|
85
85
|
const vm = {
|
|
86
86
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -82,7 +82,7 @@ export class Entry {
|
|
|
82
82
|
|
|
83
83
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
84
84
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
85
|
-
glitter.share.editerVersion = 'V_14.7.
|
|
85
|
+
glitter.share.editerVersion = 'V_14.7.5';
|
|
86
86
|
glitter.share.start = new Date();
|
|
87
87
|
const vm: {
|
|
88
88
|
appConfig: any;
|
package/package.json
CHANGED
|
@@ -439,8 +439,8 @@ class Shopping {
|
|
|
439
439
|
async querySqlByVariants(querySql, query) {
|
|
440
440
|
let sql = `SELECT v.id,
|
|
441
441
|
v.product_id,
|
|
442
|
-
v.content
|
|
443
|
-
p.content
|
|
442
|
+
v.content as variant_content,
|
|
443
|
+
p.content as product_content,
|
|
444
444
|
CAST(JSON_EXTRACT(v.content, '$.stock') AS UNSIGNED) as stock
|
|
445
445
|
FROM \`${this.app}\`.t_variants AS v
|
|
446
446
|
JOIN
|
|
@@ -825,7 +825,8 @@ class Shopping {
|
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
|
-
catch (e) {
|
|
828
|
+
catch (e) {
|
|
829
|
+
}
|
|
829
830
|
}
|
|
830
831
|
carData.shipment_fee = (() => {
|
|
831
832
|
let total_volume = 0;
|
|
@@ -885,7 +886,8 @@ class Shopping {
|
|
|
885
886
|
carData.lineItems.push(dd);
|
|
886
887
|
}
|
|
887
888
|
}
|
|
888
|
-
catch (e) {
|
|
889
|
+
catch (e) {
|
|
890
|
+
}
|
|
889
891
|
});
|
|
890
892
|
await this.checkVoucher(carData);
|
|
891
893
|
let can_add_gift = [];
|
|
@@ -2795,17 +2797,17 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
|
|
|
2795
2797
|
await new Promise((resolve, reject) => {
|
|
2796
2798
|
for (let index = 0; index < 14; index++) {
|
|
2797
2799
|
const monthCheckoutSQL = `
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2800
|
+
SELECT orderData
|
|
2801
|
+
FROM \`${this.app}\`.t_checkout
|
|
2802
|
+
WHERE
|
|
2803
|
+
DAY (created_time) = DAY (DATE_SUB(NOW()
|
|
2804
|
+
, INTERVAL ${index} DAY))
|
|
2805
|
+
AND MONTH (created_time) = MONTH (DATE_SUB(NOW()
|
|
2806
|
+
, INTERVAL ${index} DAY))
|
|
2807
|
+
AND YEAR (created_time) = YEAR (DATE_SUB(NOW()
|
|
2808
|
+
, INTERVAL ${index} DAY))
|
|
2809
|
+
AND status = 1;
|
|
2810
|
+
`;
|
|
2809
2811
|
database_js_1.default.query(monthCheckoutSQL, []).then((data) => {
|
|
2810
2812
|
pass++;
|
|
2811
2813
|
let total = 0;
|
|
@@ -3102,14 +3104,18 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
|
|
|
3102
3104
|
var _a, _b;
|
|
3103
3105
|
content.seo = (_a = content.seo) !== null && _a !== void 0 ? _a : {};
|
|
3104
3106
|
content.seo.domain = content.seo.domain || content.title;
|
|
3105
|
-
const
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3107
|
+
const language = await app_js_1.App.getSupportLanguage(this.app);
|
|
3108
|
+
for (const b of language) {
|
|
3109
|
+
const find_conflict = await database_js_1.default.query(`select count(1)
|
|
3110
|
+
from \`${this.app}\`.\`t_manager_post\`
|
|
3111
|
+
where content->>'$.language_data."${b}".seo.domain'='${decodeURIComponent(content.language_data[b].seo.domain)}'
|
|
3112
|
+
`, []);
|
|
3113
|
+
if (find_conflict[0]['count(1)'] > 0) {
|
|
3114
|
+
throw exception_js_1.default.BadRequestError('BAD_REQUEST', 'DOMAIN ALREADY EXISTS:', {
|
|
3115
|
+
message: '網域已被使用',
|
|
3116
|
+
code: '733',
|
|
3117
|
+
});
|
|
3118
|
+
}
|
|
3113
3119
|
}
|
|
3114
3120
|
try {
|
|
3115
3121
|
content.type = 'product';
|
|
@@ -3225,15 +3231,18 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
|
|
|
3225
3231
|
await Promise.all(promises);
|
|
3226
3232
|
}
|
|
3227
3233
|
async putProduct(content) {
|
|
3228
|
-
const
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3234
|
+
const language = await app_js_1.App.getSupportLanguage(this.app);
|
|
3235
|
+
for (const b of language) {
|
|
3236
|
+
const find_conflict = await database_js_1.default.query(`select count(1)
|
|
3237
|
+
from \`${this.app}\`.\`t_manager_post\`
|
|
3238
|
+
where content->>'$.language_data."${b}".seo.domain'='${decodeURIComponent(content.language_data[b].seo.domain)}'
|
|
3239
|
+
and id != ${content.id}`, []);
|
|
3240
|
+
if (find_conflict[0]['count(1)'] > 0) {
|
|
3241
|
+
throw exception_js_1.default.BadRequestError('BAD_REQUEST', 'DOMAIN ALREADY EXISTS:', {
|
|
3242
|
+
message: '網域已被使用',
|
|
3243
|
+
code: '733',
|
|
3244
|
+
});
|
|
3245
|
+
}
|
|
3237
3246
|
}
|
|
3238
3247
|
try {
|
|
3239
3248
|
content.type = 'product';
|