/** * 增加附件 * * @param string $tuduId * @param string $postId * @param array $attachment * @return boolean */ public function addAttachment($tuduId, $postId, array $attachment) { $attachnum = 0; foreach ($attachment as $attach) { if (false !== $this->_fileDao->addPost($tuduId, $postId, $attach['fileid'], (bool) $attach['isattach'])) { $attachnum++; } } return $this->_postDao->updateAttachNum($tuduId, $postId); }