protected function CALCFIELDS($flowfield_name) { if ($flowfield_name == '_permalink') { $this->qd_cached_attr[$flowfield_name] = $this->getPermalink(); //return return $this->qd_cached_attr[$flowfield_name]; } return parent::CALCFIELDS($flowfield_name); }
protected function CALCFIELDS($flowfield_name) { if ($flowfield_name == '_permalink') { $this->qd_cached_attr[$flowfield_name] = $this->getPermalink(); //return return $this->qd_cached_attr[$flowfield_name]; } if ($flowfield_name == '_price_discount') { $tmp = 0; if ($this->manual_discount_amt > 0) { $tmp = $this->price - $this->manual_discount_amt; } else { if ($this->discount_percent > 0) { $tmp = $this->price - $this->price * $this->discount_percent; } } $this->qd_cached_attr[$flowfield_name] = $tmp; //return return $tmp; } else { if ($flowfield_name == '_seo_title_preview') { $seo = $this->getSEOMeta(); foreach ($seo as $item) { if ($item->meta_name == QdSEOMeta::$META_NAME_TITLE) { $this->qd_cached_attr[$flowfield_name] = $item->_meta_value_preview; return $this->qd_cached_attr[$flowfield_name]; } } } else { if ($flowfield_name == '_seo_description_preview') { $seo = $this->getSEOMeta(); foreach ($seo as $item) { if ($item->meta_name == QdSEOMeta::$META_NAME_DESCRIPTION) { $this->qd_cached_attr[$flowfield_name] = $item->_meta_value_preview; return $this->qd_cached_attr[$flowfield_name]; } } } } } return parent::CALCFIELDS($flowfield_name); }