performance optimizations

This commit is contained in:
Frank Schubert
2022-02-15 22:26:10 +01:00
parent dd6f171ee1
commit fa3dec263f
10 changed files with 82 additions and 23 deletions

View File

@@ -282,7 +282,15 @@ class Termination extends mfBaseModel {
}
if($name == "creator") {
$user = mfValuecache::get("Worker-id-".$this->create_by);
if($user) {
$this->creator = $user;
return $this->creator;
}
$this->creator = new User($this->create_by);
if($this->creator->id) {
mfValuecache::set("Worker-id-".$this->create_by, $this->creator);
}
return $this->creator;
}

View File

@@ -4,8 +4,12 @@ class TerminationController extends mfBaseController {
protected function init() {
$this->needlogin=true;
$me = new User();
$me->loadMe();
$me = mfValuecache::get("me");
if(!$me) {
$me = new User();
$me->loadMe();
mfValuecache::set("me", $this->me);
}
$this->me = $me;
$this->layout()->set("me",$me);

View File

@@ -30,8 +30,12 @@ class TerminationModel {
$model->status_id = 1;
}
$me = new User();
$me->loadMe();
$me = mfValuecache::get("me");
if(!$me) {
$me = new User();
$me->loadMe();
mfValuecache::set("me", $this->me);
}
if($model->create_by === null) {
$model->create_by = $me->id;