public function run($ids) { Wind::import('SRV:forum.dm.PwTopicDm'); Wind::import('SRV:forum.dm.PwReplyDm'); $threadDs = Wekit::load('forum.PwThread'); $forumSrv = Wekit::load('forum.srv.PwForumService'); foreach ($this->tids as $tid => $value) { $dm1 = new PwReplyDm(true); $dm1->setTid($tid); $value['disabled'] != 2 && $dm1->setDisabled(0); $threadDs->batchUpdatePost($value['ids'], $dm1); $post = current(Wekit::load('forum.PwThread')->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies($value['replies']); $post && $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); $threadDs->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($this->fids as $fid => $value) { $forumSrv->updateStatistics($fid, 0, $value); } foreach ($this->rpids as $rpid => $value) { $dm = new PwReplyDm($rpid); $dm->addReplies($value); $threadDs->updatePost($dm); } Wekit::load('recycle.PwReplyRecycle')->batchDelete($ids); }
public function run($ids) { $service = Wekit::load('forum.PwThread'); $service->batchDeletePost($ids); foreach ($this->tids as $tid => $value) { $post = current($service->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies(-$value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } if ($this->recode) { Wekit::load('recycle.PwReplyRecycle')->batchDelete($this->recode); } }
public function run($ids) { Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $service = Wekit::load('forum.PwThread'); $dm = new PwReplyDm(); $dm->setDisabled(2)->setTid(0); $service->batchUpdatePost($ids, $dm); foreach ($this->tids as $tid => $value) { $post = current($service->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies(-$value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } Wekit::load('recycle.PwReplyRecycle')->batchAdd($this->record); }
/** * 复制帖子 | 复制特殊帖、附件等待做。。。 * * @param int $topictype * @return int */ public function run() { foreach ($this->threads as $v) { $topicDm = new PwTopicDm($v['tid']); $topicDm->setLastpost($v['lastpost_userid'], $v['lastpost_username'], $v['lastpost_time'])->setSpecial($v['special'])->setDigest($v['digest'])->setTopped($v['topped'])->setSpecialsort($v['special_sort'])->setTopictype($this->topictype)->setTpcstatus($v['tpcstatus'])->setHighlight($v['highlight'])->setOvertime($v['overtime'])->addHits($v['hits'])->setTitle($v['subject'])->setContent($v['content'])->setFid($this->fid)->setAuthor($v['created_userid'], $v['created_username'], $v['created_ip'])->setModifyInfo($v['modified_userid'], $v['modified_username'], $v['modified_ip'], $v['modified_time'])->setCreatedTime($v['created_time'])->setDisabled($v['disabled'])->setAids($v['aids'])->setIfupload($v['ifupload'])->setReplyNotice($v['reply_notice'])->setLikeCount($v['like_count'])->setSellCount($v['sell_count'])->addReplies($v['replies'])->addSellCount($v['sell_count'])->setReminds($v['reminds'])->setWordVersion($v['word_version'])->setTags($v['tags']); $tid = $this->_getThreadDs()->addThread($topicDm); if ($tid) { PwSimpleHook::getInstance('PwThreadManageDoCopy')->runDo($topicDm, $tid); $forumDm = new PwForumDm($this->fid); $forumDm->addThreads(1); $forumDm->addArticle(1); Wekit::load('SRV:forum.PwForum')->updateForum($forumDm); } } //管理日志添加 Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'copy', $this->threads, $this->_reason, $this->fid . '|' . $this->topictype); }
protected function run() { Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwReplyDm(true); $dm->setDisabled(0); Wekit::load('forum.PwThread')->batchUpdatePost($this->pids, $dm); foreach ($this->tids as $tid => $value) { $post = current(Wekit::load('forum.PwThread')->getPostByTid($tid, 1, 0, false)); $dm = new PwTopicDm($tid); $dm->addReplies($value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($this->fids as $fid => $value) { Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, 0, $value, $value); } foreach ($this->rpids as $rpid => $value) { $dm = new PwReplyDm($rpid); $dm->addReplies($value); Wekit::load('forum.PwThread')->updatePost($dm); } return true; }
public function doPassPostAction() { $pid = $this->getInput('pid'); if (empty($pid)) { $this->showError('operate.select'); } !is_array($pid) && ($pid = array($pid)); $fids = $tids = array(); $postdb = Wekit::load('forum.PwThread')->fetchPost($pid); foreach ($postdb as $key => $value) { $fids[$value['fid']]++; $tids[$value['tid']]++; } Wind::import('SRV:forum.dm.PwReplyDm'); Wind::import('SRV:forum.dm.PwTopicDm'); $dm = new PwReplyDm(true); $dm->setDisabled(0); Wekit::load('forum.PwThread')->batchUpdatePost($pid, $dm); foreach ($tids as $key => $value) { $post = current(Wekit::load('forum.PwThread')->getPostByTid($key, 1, 0, false)); $dm = new PwTopicDm($key); $dm->addReplies($value); $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']); Wekit::load('forum.PwThread')->updateThread($dm, PwThread::FETCH_MAIN); } foreach ($fids as $fid => $value) { Wekit::load('forum.srv.PwForumService')->updateStatistics($fid, 0, $value, $value); } $this->showMessage('success'); }