* [story #68129, doing] support for seting catelog orders param as the same as sortDoc.

This commit is contained in:
sunhao
2024-10-16 09:43:47 +08:00
committed by 刘刚
parent 48affaedc0
commit d16874681d
+4 -1
View File
@@ -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'));