* Code for task #91391.

This commit is contained in:
tianshujie
2023-04-18 10:23:03 +08:00
parent b4c325c56e
commit 32161d8d66
4 changed files with 77 additions and 7 deletions
+21
View File
@@ -983,4 +983,25 @@ class api extends control
{
echo $this->fetch('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=$confirm");
}
/**
* Catalog sort.
*
* @access public
* @return void
*/
public function sortCatalog()
{
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
foreach($_POST['orders'] as $id => $order)
{
$this->dao->update(TABLE_MODULE)->set('`order`')->eq($order)->where('id')->eq($id)->andWhere('type')->eq('api')->exec();
}
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
return $this->send(array('result' => 'success'));
}
}
}