befly 3.16.7 → 3.16.8
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/befly.js +13 -1
- package/dist/befly.min.js +14 -14
- package/dist/lib/dbHelper.js +15 -1
- package/dist/types/api.d.ts +5 -8
- package/package.json +2 -2
package/dist/befly.js
CHANGED
|
@@ -15697,6 +15697,13 @@ class DbHelper {
|
|
|
15697
15697
|
const countExecRes = await this.executeSelect(countSql, countParams);
|
|
15698
15698
|
const total = countExecRes.data?.[0]?.total || 0;
|
|
15699
15699
|
if (total === 0) {
|
|
15700
|
+
const offset2 = (prepared.page - 1) * prepared.limit;
|
|
15701
|
+
const dataBuilder2 = this.createSqlBuilder().select(prepared.fields).from(prepared.table).where(whereFiltered).limit(prepared.limit).offset(offset2);
|
|
15702
|
+
this.applyJoins(dataBuilder2, prepared.joins);
|
|
15703
|
+
if (prepared.orderBy && prepared.orderBy.length > 0) {
|
|
15704
|
+
dataBuilder2.orderBy(prepared.orderBy);
|
|
15705
|
+
}
|
|
15706
|
+
const { sql: dataSql2, params: dataParams2 } = dataBuilder2.toSelectSql();
|
|
15700
15707
|
return {
|
|
15701
15708
|
data: {
|
|
15702
15709
|
lists: [],
|
|
@@ -15706,7 +15713,12 @@ class DbHelper {
|
|
|
15706
15713
|
pages: 0
|
|
15707
15714
|
},
|
|
15708
15715
|
sql: {
|
|
15709
|
-
count: countExecRes.sql
|
|
15716
|
+
count: countExecRes.sql,
|
|
15717
|
+
data: {
|
|
15718
|
+
sql: dataSql2,
|
|
15719
|
+
params: dataParams2,
|
|
15720
|
+
duration: 0
|
|
15721
|
+
}
|
|
15710
15722
|
}
|
|
15711
15723
|
};
|
|
15712
15724
|
}
|