'secondary_id')), ); public function newTitle($data) { return $this->createAdd($data); } public function updateTitle($data) { return $this->createSave($data); } protected function getTime() { $time = time(); $datetime = date("Y-m-d H:i:s", $time); return $datetime; } public function getConditionList($id) { return $this->join('__SECONDARY_NEWS__ ON __SECONDARY_TITLE__.id = __SECONDARY_NEWS__.secondary_id') ->where(array('tz_secondary_title.id' => $id)) ->field('tz_secondary_news.*')->find(); } public function getKeywordName($id) { $k_model = D('Keywords'); $k_data = $k_model->where(array('id' => $id))->find(); return $k_data['name']; } public function getCateName($id) { $k_model = D('NewsCate'); $k_data = $k_model->where(array('id' => $id))->find(); return $k_data['name']; } public function extraKeyword($str) { $str = trim($str); if ($str == '') { return ''; } $arr = explode(',', $str); foreach ($arr as &$a) { $a = $this->getKeywordName($a); } $re = join(',', $arr); return $re; } public function extraCate($str) { $str = trim($str); if ($str == '') { return ''; } $arr = explode(',', $str); foreach ($arr as &$a) { $a = $this->getCateName($a); } $re = join(',', $arr); return $re; } }