@pisell/pisellos 2.2.147 → 2.2.148
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.
|
@@ -70,7 +70,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
70
70
|
value: function () {
|
|
71
71
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
72
72
|
var _options$initialState;
|
|
73
|
-
var appPlugin, app, _this$store$createdAt, coreData, today, operatingDayBoundary, boundaryTime, boundaryStart,
|
|
73
|
+
var appPlugin, app, _this$store$createdAt, coreData, today, operatingDayBoundary, boundaryTime, boundaryStart, isAfterBoundary, queryStart, queryEnd;
|
|
74
74
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
75
75
|
while (1) switch (_context.prev = _context.next) {
|
|
76
76
|
case 0:
|
|
@@ -91,10 +91,12 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
91
91
|
if (operatingDayBoundary.type === 'start_time') {
|
|
92
92
|
boundaryTime = String(operatingDayBoundary.time || '').trim();
|
|
93
93
|
boundaryStart = dayjs("".concat(today.format('YYYY-MM-DD'), " ").concat(boundaryTime));
|
|
94
|
-
boundaryEnd = boundaryStart.add(1, 'day');
|
|
95
94
|
if (boundaryStart.isValid()) {
|
|
95
|
+
isAfterBoundary = today.isAfter(boundaryStart);
|
|
96
|
+
queryStart = isAfterBoundary ? today.startOf('day') : today.subtract(1, 'day').startOf('day');
|
|
97
|
+
queryEnd = isAfterBoundary ? today.add(1, 'day').endOf('day') : today.endOf('day');
|
|
96
98
|
this.store.createdAtQuery = {
|
|
97
|
-
sales_time_between: [
|
|
99
|
+
sales_time_between: [queryStart.format('YYYY-MM-DD HH:mm:ss'), queryEnd.format('YYYY-MM-DD HH:mm:ss')]
|
|
98
100
|
};
|
|
99
101
|
} else {
|
|
100
102
|
// 边界时间异常时回退到自然日,避免 createdAtQuery 为空导致后续查询异常
|
|
@@ -71,12 +71,14 @@ var OrderModule = class extends import_BaseModule.BaseModule {
|
|
|
71
71
|
if (operatingDayBoundary.type === "start_time") {
|
|
72
72
|
const boundaryTime = String(operatingDayBoundary.time || "").trim();
|
|
73
73
|
const boundaryStart = (0, import_dayjs.default)(`${today.format("YYYY-MM-DD")} ${boundaryTime}`);
|
|
74
|
-
const boundaryEnd = boundaryStart.add(1, "day");
|
|
75
74
|
if (boundaryStart.isValid()) {
|
|
75
|
+
const isAfterBoundary = today.isAfter(boundaryStart);
|
|
76
|
+
const queryStart = isAfterBoundary ? today.startOf("day") : today.subtract(1, "day").startOf("day");
|
|
77
|
+
const queryEnd = isAfterBoundary ? today.add(1, "day").endOf("day") : today.endOf("day");
|
|
76
78
|
this.store.createdAtQuery = {
|
|
77
79
|
sales_time_between: [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
queryStart.format("YYYY-MM-DD HH:mm:ss"),
|
|
81
|
+
queryEnd.format("YYYY-MM-DD HH:mm:ss")
|
|
80
82
|
]
|
|
81
83
|
};
|
|
82
84
|
} else {
|