@freedom_sky/feige-lib 4.54.0 → 4.54.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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/index.ts +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -187,4 +187,4 @@ export declare function getLanguageFromCountryCode(countryCode: any): string;
|
|
|
187
187
|
* @param {Order} order 店铺
|
|
188
188
|
* @returns {Number} 返回当前数量
|
|
189
189
|
*/
|
|
190
|
-
export declare function
|
|
190
|
+
export declare function getDishCountByIdInAllUncanceledTasks(order: Order, dishId: string): Number;
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ exports.calcContentPrice = calcContentPrice;
|
|
|
147
147
|
*/
|
|
148
148
|
function getOrderedCountByDishId(dishId, contents, beforeKey) {
|
|
149
149
|
var count = 0;
|
|
150
|
-
for (var _i = 0, _a = contents.filter(function (content) { return String(content.dishSnapshot._id) === String(dishId); }); _i < _a.length; _i++) {
|
|
150
|
+
for (var _i = 0, _a = contents.filter(function (content) { return !content.retreated && String(content.dishSnapshot._id) === String(dishId); }); _i < _a.length; _i++) {
|
|
151
151
|
var content = _a[_i];
|
|
152
152
|
if (beforeKey && String(content._id) === String(beforeKey))
|
|
153
153
|
break;
|
|
@@ -521,7 +521,7 @@ exports.getLanguageFromCountryCode = getLanguageFromCountryCode;
|
|
|
521
521
|
* @param {Order} order 店铺
|
|
522
522
|
* @returns {Number} 返回当前数量
|
|
523
523
|
*/
|
|
524
|
-
function
|
|
524
|
+
function getDishCountByIdInAllUncanceledTasks(order, dishId) {
|
|
525
525
|
var count = 0;
|
|
526
526
|
if (order.tasks) {
|
|
527
527
|
count = order.tasks.filter(function (task) { return task.status !== const_1.CONST.STATUS.CANCELLED; }).reduce(function (count, task) {
|
|
@@ -530,4 +530,4 @@ function getDishCountById(order, dishId) {
|
|
|
530
530
|
}
|
|
531
531
|
return count;
|
|
532
532
|
}
|
|
533
|
-
exports.
|
|
533
|
+
exports.getDishCountByIdInAllUncanceledTasks = getDishCountByIdInAllUncanceledTasks;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -178,10 +178,10 @@ export function calcContentPrice({
|
|
|
178
178
|
*/
|
|
179
179
|
export function getOrderedCountByDishId(dishId, contents: Content[], beforeKey?: string): number {
|
|
180
180
|
let count = 0;
|
|
181
|
-
for (const content of contents.filter((content) => String(content.dishSnapshot._id) === String(dishId))) {
|
|
181
|
+
for (const content of contents.filter((content) => !content.retreated && String(content.dishSnapshot._id) === String(dishId))) {
|
|
182
182
|
if (beforeKey && String(content._id) === String(beforeKey)) break;
|
|
183
183
|
count += content.count;
|
|
184
|
-
}
|
|
184
|
+
}
|
|
185
185
|
return count;
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -567,7 +567,7 @@ export function getLanguageFromCountryCode(countryCode): string {
|
|
|
567
567
|
* @param {Order} order 店铺
|
|
568
568
|
* @returns {Number} 返回当前数量
|
|
569
569
|
*/
|
|
570
|
-
export function
|
|
570
|
+
export function getDishCountByIdInAllUncanceledTasks(order: Order, dishId: string): Number {
|
|
571
571
|
let count = 0;
|
|
572
572
|
if (order.tasks) {
|
|
573
573
|
count = order.tasks.filter(task=>task.status!==CONST.STATUS.CANCELLED).reduce((count, task) => {
|