* finish task #959.

This commit is contained in:
wangyidong
2012-12-11 01:14:57 +00:00
parent 53101768d9
commit 3c04a1671c

View File

@@ -429,9 +429,14 @@ class treeModel extends model
*/
public function updateOrder($orders)
{
asort($orders);
$i = 0;
foreach($orders as $moduleID => $order)
{
$this->dao->update(TABLE_MODULE)->set('`order`')->eq($order)->where('id')->eq((int)$moduleID)->limit(1)->exec();
$i++;
$newOrder = $i * 10;
if($newOrder == $order) continue;
$this->dao->update(TABLE_MODULE)->set('`order`')->eq($newOrder)->where('id')->eq((int)$moduleID)->limit(1)->exec();
}
}