From d16874681d459aecf24486fb72017f33c5d33b79 Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 15 Oct 2024 19:44:52 +0800 Subject: [PATCH] * [story #68129, doing] support for seting catelog orders param as the same as sortDoc. --- module/doc/control.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/doc/control.php b/module/doc/control.php index 0fe19d8f63..ebc7e796f0 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1092,7 +1092,10 @@ class doc extends control { if($_POST) { - foreach($_POST['orders'] as $id => $order) $this->doc->updateOrder($id, (int)$order, $_POST['type']); + $orders = $_POST['orders']; + $type = isset($_POST['type']) ? $_POST['type'] : 'doc'; + if(is_string($orders)) $orders = json_decode($orders, true); + foreach($orders as $id => $order) $this->doc->updateOrder($id, (int)$order, $type); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); return $this->send(array('result' => 'success'));