* Adjust file comment.

This commit is contained in:
caoyanyi
2023-09-14 13:54:36 +08:00
parent 5044f83d98
commit 52688dba48
2 changed files with 32 additions and 9 deletions
+7 -9
View File
@@ -1,11 +1,12 @@
<?php
declare(strict_types=1);
/**
* The control file of program module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package program
* @version $Id
* @link http://www.zentao.net
*/
class program extends control
@@ -640,15 +641,12 @@ class program extends control
public function updateOrder()
{
$programs = $this->post->programs;
foreach($programs as $id => $order)
{
$this->dao->update(TABLE_PROJECT)
->set('`order`')->eq($order)
->where('id')->eq($id)
->exec();
}
if(!$programs) return $this->send(array('result' => 'success'));
$this->send(array('result' => 'success'));
foreach($programs as $programID => $order) $this->program->updateOrder((int) $programID, (int) $order);
if(dao::isError()) return $this->sendError(dao::getError());
return $this->send(array('result' => 'success'));
}
/*
+25
View File
@@ -1,4 +1,14 @@
<?php
declare(strict_types=1);
/**
* The model file of program module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package program
* @link http://www.zentao.net
*/
class programModel extends model
{
/**
@@ -1783,4 +1793,19 @@ class programModel extends model
->orderBy('order_asc')
->fetchGroup('program');
}
/**
* 更新项目集排序。
* Update the order of the program.
*
* @param int $programID
* @param int $order
* @access public
* @return bool
*/
public function updateOrder(int $programID, int $order): bool
{
$this->dao->update(TABLE_PROGRAM)->set('`order`')->eq($order)->where('id')->eq($programID)->exec();
return !dao::isError();
}
}