* [refac] optimize code.

This commit is contained in:
tianshujie
2025-09-18 16:29:11 +08:00
parent 92a69c2e64
commit b3a9b72a88
+7 -7
View File
@@ -807,17 +807,17 @@ class weeklyModel extends model
{
/* Set milestone report data. */
$report = new stdclass();
$report->addedBy = 'system';
$report->addedDate = helper::now();
$report->addedBy = 'system';
$report->addedDate = helper::now();
$report->templateType = 'projectReport';
$report->module = 'milestone';
$stages = $this->dao->select('id,name,project')->from(TABLE_PROJECT)->where('type')->eq('stage')->andWhere('milestone')->eq('1')->fetchAll('id');
foreach($stages as $stageID => $stage)
{
$report->project = $stage->project;
$report->execution = $stageID;
$report->title = sprintf($this->lang->weekly->milestoneTitle, $stage->name);
$report->templateType = 'projectReport';
$report->module = 'milestone';
$report->project = $stage->project;
$report->execution = $stageID;
$report->title = sprintf($this->lang->weekly->milestoneTitle, $stage->name);
$this->dao->insert(TABLE_DOC)->data($report)->exec();
}