Add caching for network sections and add indexes for order tables
This commit is contained in:
@@ -125,7 +125,12 @@ class Network extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($name == "sections") {
|
||||
$this->sections = NetworksectionModel::search(['network_id' => $this->id]);
|
||||
$cache_key = "network_".$this->id."_sections";
|
||||
$this->sections = mfValuecache::singleton()->get($cache_key);
|
||||
if($this->sections === NULL) {
|
||||
$this->sections = NetworksectionModel::search(['network_id' => $this->id]);
|
||||
mfValuecache::singleton()->set($cache_key, $this->sections);
|
||||
}
|
||||
return $this->sections;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user