public function copyThread(PwTopicDm $topicDm, $newTid) { $ifupload = $topicDm->getField('ifupload'); if (!$ifupload) { return; } $tid = $topicDm->tid; $this->attachs = $this->_getService()->getAttachByTid($tid, array(0)); if (!$this->attachs) { return; } foreach ($this->attachs as $v) { $dm = new PwThreadAttachDm(); $dm->setFid($v['fid'])->setTid($newTid)->setPid($v['pid'])->setWidth($v['width'])->setHeight($v['height'])->setSpecial($v['special'])->setCost($v['cost'])->setCtype($v['ctype'])->addHits($v['hits'])->setName($v['name'])->setType($v['type'])->setSize($v['size'])->setPath($v['path'])->setIfthumb($v['ifthumb'])->setCreatedUser($v['created_userid'])->setCreatedTime($v['created_time'])->setApp($v['app'])->setDescrip($v['descrip']); $this->_getService()->addAttach($dm); } }
public function addPost($pid, $tid) { if ($aids = $this->action->getAids()) { $dm = new PwThreadAttachDm(); $dm->setFid($this->fid); $dm->setPid($pid); $dm->setTid($tid); $this->_getService()->batchUpdateAttach($aids, $dm); $this->post->getUserDm()->addTodayupload(count($aids)); $this->_operateCredit('upload_att'); } }