From e51bb879513a15492019dbdf7eeb751fed950c9e Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 2 Nov 2023 14:16:37 +0800 Subject: [PATCH] * Append `_desc` to `orderby` if it doesn't have `_`. --- lib/zin/wg/dtable/v1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zin/wg/dtable/v1.php b/lib/zin/wg/dtable/v1.php index 7c6014b292..7cf8139fab 100644 --- a/lib/zin/wg/dtable/v1.php +++ b/lib/zin/wg/dtable/v1.php @@ -130,7 +130,7 @@ class dtable extends wg $orderBy = $this->prop('orderBy'); if(is_string($orderBy)) { - list($orderByName, $orderByType) = explode('_', $orderBy); + list($orderByName, $orderByType) = explode('_', strpos($orderBy, '_') === false ? $orderBy . '_desc' : $orderBy); $this->setProp('orderBy', array($orderByName => $orderByType)); }