大更新

This commit is contained in:
2026-08-08 19:16:58 +08:00
parent d289f8d6e2
commit ae5dc3eb46
178 changed files with 69427 additions and 525 deletions
@@ -328,9 +328,18 @@ private:
const auto view = describe_table_view<T>();
const std::string order_by = query.order_by.empty() ? view.default_order_by : query.order_by;
const std::string order_dir = query.order_by.empty() ? view.default_order_dir : query.order_dir.empty() ? "asc" : query.order_dir;
if(order_by.empty() || !is_sortable_field(order_by)) {
if(order_by.empty()) {
return;
}
if(!is_sortable_field(order_by)) {
if(!query.order_by.empty()) {
throw std::invalid_argument("table query field is not sortable: " + order_by);
}
return;
}
if(order_dir != "asc" && order_dir != "desc") {
throw std::invalid_argument("table order direction must be asc or desc");
}
const bool descending = order_dir == "desc";
std::stable_sort(entries.begin(), entries.end(), [&](const Entry* left, const Entry* right) {
int comparison{};