* [misc,done,0.5h] optimize code.

This commit is contained in:
liumengyi
2024-12-11 17:15:30 +08:00
committed by 田淑杰
parent 2f53836a38
commit c69fec12e6
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -444,16 +444,15 @@ class programplanModel extends model
if(dao::isError()) return false;
/* Synchronously update sub-phase permissions. */
$childIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('parent')->eq($planID)->fetchAll('id');
if(!empty($childIdList)) $this->dao->update(TABLE_PROJECT)->set('acl')->eq($plan->acl)->where('id')->in(array_keys($childIdList))->exec();
$childIdList = $this->dao->select('id')->from(TABLE_PROJECT)->where('path')->like("%,$planID,%")->fetchPairs();
if(!empty($childIdList)) $this->dao->update(TABLE_PROJECT)->set('acl')->eq($plan->acl)->where('id')->in($childIdList)->exec();
$this->setTreePath($planID);
$this->updateSubStageAttr($planID, $plan->attribute);
if($plan->acl != 'open')
{
$planIdList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('path')->like("%,$planID,%")->andWhere('type')->ne('project')->fetchAll('id');
$this->loadModel('user')->updateUserView(array_keys($planIdList), 'sprint');
$this->loadModel('user')->updateUserView($childIdList, 'sprint');
}
if($changes)