* [task#133002,doing,0.1h] refactor.

This commit is contained in:
zhouxin
2024-11-25 15:40:31 +08:00
committed by 宋辰轩
parent a1a06ce976
commit 3ee4c5fe44
+6 -2
View File
@@ -79,6 +79,11 @@ class pivot extends control
*/
public function versions(int $groupID, int $pivotID, string $version = 'newest')
{
$pivot = $this->pivot->getByID($pivotID);
if($version == 'newest') $version = $this->pivot->getMaxVersion($pivotID);
if($version == 'current') $version = $pivot->version;
$versionSpecs = $this->pivot->getPivotVersions($pivotID);
if(empty($versionSpecs)) $this->sendError($this->lang->pivot->tipNoVersions);
@@ -88,11 +93,10 @@ class pivot extends control
if($result) $this->sendSuccess(array('closeModal' => true, 'message' => $this->lang->saveSuccess, 'load' => true));
}
$pivot = $this->pivot->getByID($pivotID);
$this->pivotZen->show($groupID, $pivotID, '', $version);
$this->view->versionSpecs = $versionSpecs;
$this->view->version = $version == 'newest' ? $this->pivot->getMaxVersion($pivotID) : $version;
$this->view->version = $version;
$this->view->pivot = $pivot;
$this->view->groupID = $groupID;
$this->view->pivotID = $groupID;